Linux System Information Cheatsheet
Commands that show Linux system information: distro and kernel version, CPU, memory, disks, hardware, firmware, uptime, and boot history.
These commands were checked on Ubuntu 26.04, Debian 13, and Rocky Linux 10. The Missing Commands card lists the packages to install when a tool is missing.
Distribution and Release
/etc/os-release exists on every current distribution and is the best first check.
| Command | Description |
|---|---|
cat /etc/os-release | Distribution name, version, ID, and codename |
grep PRETTY_NAME /etc/os-release | One-line name, such as Ubuntu 26.04.1 LTS |
(. /etc/os-release && echo "$ID $VERSION_ID") | ID and version for scripts; prints ubuntu 26.04 |
hostnamectl | OS, kernel, architecture, and hardware model in one view |
lsb_release -a | Distributor, description, release, and codename |
lsb_release -cs | Codename only, such as resolute or trixie |
cat /etc/debian_version | Debian point release, such as 13.8; Ubuntu prints its Debian base (forky/sid) |
cat /etc/redhat-release | Release line on RHEL, Rocky, AlmaLinux, and Fedora |
Kernel
The kernel version is separate from the distribution version.
| Command | Description |
|---|---|
uname -r | Kernel release, such as 7.0.0-31-generic |
uname -a | Kernel name, hostname, release, build, and architecture |
uname -srm | Kernel name, release, and machine on one line |
cat /proc/version | Kernel version and the compiler that built it |
dpkg --list 'linux-image*' | grep ^ii | Installed kernels on Debian and Ubuntu |
rpm -q kernel-core | Installed kernels on RHEL, Rocky, and Fedora |
cat /proc/cmdline | Parameters the running kernel booted with |
lsmod | Loaded kernel modules |
sudo dmesg | Kernel messages; Debian and Ubuntu require root |
CPU
lscpu collects the data from /proc/cpuinfo and sysfs into one summary.
| Command | Description |
|---|---|
lscpu | Architecture, model, cores, threads, caches, and flags |
LC_ALL=C lscpu | grep 'Model name:' | CPU model, when reported by the system |
lscpu -e | One row per logical CPU with its core, socket, and online state |
lscpu -C | Cache sizes per level |
nproc | Processing units available to the current process |
nproc --all | All installed processing units |
grep -c ^processor /proc/cpuinfo | Count logical CPUs |
uname -m | Machine architecture, x86_64 or aarch64; uname -p and uname -i usually print unknown |
dpkg --print-architecture | Package architecture on Debian and Ubuntu, amd64 or arm64 |
getconf LONG_BIT | Prints 64 on a 64-bit system |
sudo dmidecode -t processor | Socket, speed, and CPU details from the firmware |
Memory
Read the available column to see how much memory you can still give to new programs without swapping.
| Command | Description |
|---|---|
free -h | Total, used, free, and available RAM and swap |
free -h -t | Add a Total row for RAM plus swap |
free -h -s 2 | Repeat every 2 seconds; stop with Ctrl+C |
grep -E 'MemTotal|MemAvailable' /proc/meminfo | Total and available RAM in kB |
swapon --show | Active swap files and partitions; no output means no swap |
vmstat -y 2 5 | Five 2-second reports on memory, swap, I/O, and CPU. -y skips the since-boot report. |
lsmem | Memory block size and total online memory |
sudo dmidecode -t memory | Installed modules with size, type, speed, and empty slots |
Disks and Filesystems
lsblk lists block devices. df reports space on mounted filesystems.
| Command | Description |
|---|---|
lsblk | Disks, partitions, sizes, and mount points |
lsblk -f | Filesystem type, label, UUID, and free space |
lsblk -d -e7 -o NAME,SIZE,MODEL,TRAN | Whole disks with model and transport; -e7 hides loop devices |
df -h | Size, used, and available space per filesystem |
df -hT / | Type and space of the root filesystem |
findmnt -T /etc/hosts | Source and mount options for the filesystem containing the given path |
sudo blkid | UUIDs and filesystem types for /etc/fstab |
sudo smartctl -i /dev/sda | Drive model, serial number, and firmware; use /dev/nvme0n1 for NVMe |
Hardware and Firmware
dmidecode reads the firmware tables and needs root. Files in /sys/class/dmi/id/ are readable by any user, except the serial numbers.
| Command | Description |
|---|---|
sudo lshw -short | Hardware summary grouped by class |
lspci | PCI devices: graphics, network, storage, and USB controllers |
lspci -k | PCI devices with the kernel driver in use |
lspci | grep -iE 'vga|3d|display' | Graphics card |
lsusb | USB devices |
cat /sys/class/dmi/id/product_name | Machine model, no root needed |
cat /sys/class/dmi/id/sys_vendor | Manufacturer, no root needed |
sudo dmidecode -s system-serial-number | Serial number |
sudo dmidecode -t bios | Firmware vendor, version, and release date |
[ -d /sys/firmware/efi ] && echo UEFI || echo 'UEFI not detected' | Check whether Linux detects an EFI boot |
systemd-detect-virt | Virtualization type, such as kvm or qemu; none on bare metal |
nvidia-smi | NVIDIA GPU, driver version, and CUDA version |
Uptime and Boot
How long the system has been running and how it started.
| Command | Description |
|---|---|
uptime | Current time, uptime, logged-in users, and load averages |
uptime -p | Uptime in words, such as up 2 days, 10 hours, 55 minutes |
uptime -s | Date and time of the last boot |
who -b | Last boot time |
journalctl --list-boots | Boots recorded in the journal, oldest first |
last reboot | Reboot history; Debian 13 and Ubuntu 26.04 need wtmpdb, which starts recording at the next boot |
systemd-analyze | How long the last boot took |
systemctl get-default | Default boot target, graphical.target or multi-user.target |
w | Logged-in users and what they are running |
Hostname, Time, and Network
Identity and address details for the machine.
| Command | Description |
|---|---|
hostname | Hostname |
hostnamectl hostname | Static hostname on systemd systems |
hostname -I | IP addresses without interface names. Debian and Ubuntu omit loopback and IPv6 link-local addresses. |
ip -br addr | Interfaces with their state and addresses |
timedatectl | Time zone, local and UTC time, and NTP sync status |
Summary Tools
These print a whole system overview in one command. neofetch is no longer packaged in Debian 13 or Ubuntu 26.04; use fastfetch.
| Command | Description |
|---|---|
inxi -b | Basic report: system, machine, CPU, graphics, network, and drives |
inxi -Fz | Full report with IP addresses and serial numbers filtered out |
inxi -C | CPU section only |
fastfetch | Distro logo next to OS, kernel, CPU, GPU, memory, and disk |
fastfetch -l none | The same summary without the logo |
hostnamectl | Built-in summary on systemd systems; nothing to install |
Missing Commands
Minimal and cloud images often leave these tools out. When you get command not found, install the package with apt or dnf. Package names match across distributions unless noted.
| Command | Package |
|---|---|
lsb_release | lsb-release on Debian and Ubuntu; not in the Rocky 10 base repositories |
lspci | pciutils |
lsusb | usbutils |
lshw | lshw |
dmidecode | dmidecode |
smartctl | smartmontools |
last | wtmpdb on Debian 13 and Ubuntu 26.04; util-linux on Rocky 10 |
inxi | inxi on Debian and Ubuntu; not in EPEL 10 |
fastfetch | fastfetch; from EPEL on Rocky and RHEL 10 |
Related Guides
Use these guides for worked examples and full output.
| Guide | Description |
|---|---|
| How to Check Linux Version | Distro and kernel version on any distribution |
| How to Check Your Ubuntu Version | Ubuntu release from the terminal and the desktop |
| How to Check Your Debian Version | Debian point release and codename |
| How to Check the Kernel Version in Linux | uname, /proc/version, and installed kernels |
| CPU Info on Linux | lscpu, /proc/cpuinfo, and core counts |
| How to Check Memory Usage in Linux | free, top, and /proc/meminfo |
| List Hardware in Linux | lsusb, lspci, and lshw |
| lsblk Command in Linux | Block devices, filesystems, and UUIDs |
| smartctl Command in Linux | Drive identity and SMART health |
| df Cheatsheet | Disk space and inode usage |