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_releaseon systems without thelsb-releasepackage installed will cause an error. - Using
unamewithout options shows limited info; use-afor full details. - Confusing
freeoutput units; use-hfor human-readable sizes.
bash
lsb_release -a # If command not found, install with: sudo apt-get install lsb-release
Quick Reference
| Command | Purpose |
|---|---|
| uname -a | Show kernel and system architecture details |
| lsb_release -a | Display Linux distribution info |
| lscpu | Show CPU architecture and specs |
| free -h | Display memory usage in human-readable format |
| df -h | Show 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.