0
0
Linux-cliHow-ToBeginner · 3 min read

How to Check System Info on Linux: Commands and Examples

To check system info on Linux, use commands like uname -a for kernel details, lsb_release -a for OS info, and lscpu for CPU details. These commands give quick insights about your system's hardware and software.
📐

Syntax

Here are common commands to check system info on Linux:

  • uname -a: Shows kernel name, version, and system architecture.
  • lsb_release -a: Displays Linux distribution details.
  • lscpu: Provides CPU architecture and details.
  • free -h: Shows memory usage in human-readable format.
  • df -h: Displays disk space usage.
bash
uname -a
lsb_release -a
lscpu
free -h
df -h
💻

Example

This example runs uname -a to show kernel and system info, and lsb_release -a to show distribution details.

bash
uname -a
lsb_release -a
Output
Linux myhostname 5.15.0-60-generic #66-Ubuntu SMP Fri Jan 27 22:54:38 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04.2 LTS Release: 22.04 Codename: jammy
⚠️

Common Pitfalls

Some common mistakes when checking system info:

  • Running lsb_release on systems without the lsb-release package installed will cause an error.
  • Using uname without options shows limited info; use -a for full details.
  • Confusing free output units; use -h for human-readable sizes.
bash
lsb_release -a
# If command not found, install with:
sudo apt-get install lsb-release
📊

Quick Reference

CommandPurpose
uname -aShow kernel and system architecture details
lsb_release -aDisplay Linux distribution info
lscpuShow CPU architecture and specs
free -hDisplay memory usage in human-readable format
df -hShow disk space usage in human-readable format

Key Takeaways

Use uname -a to get full kernel and system architecture info.
Run lsb_release -a to see your Linux distribution details.
Use lscpu to check CPU information quickly.
Add -h option to commands like free and df for easy-to-read output.
Install missing packages like lsb-release if commands are not found.