Skip to main content

Linux System Information Cheatsheet

By Dejan Panovski •Updated on • Download PDF

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.

CommandDescription
cat /etc/os-releaseDistribution name, version, ID, and codename
grep PRETTY_NAME /etc/os-releaseOne-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
hostnamectlOS, kernel, architecture, and hardware model in one view
lsb_release -aDistributor, description, release, and codename
lsb_release -csCodename only, such as resolute or trixie
cat /etc/debian_versionDebian point release, such as 13.8; Ubuntu prints its Debian base (forky/sid)
cat /etc/redhat-releaseRelease line on RHEL, Rocky, AlmaLinux, and Fedora

Kernel

The kernel version is separate from the distribution version.

CommandDescription
uname -rKernel release, such as 7.0.0-31-generic
uname -aKernel name, hostname, release, build, and architecture
uname -srmKernel name, release, and machine on one line
cat /proc/versionKernel version and the compiler that built it
dpkg --list 'linux-image*' | grep ^iiInstalled kernels on Debian and Ubuntu
rpm -q kernel-coreInstalled kernels on RHEL, Rocky, and Fedora
cat /proc/cmdlineParameters the running kernel booted with
lsmodLoaded kernel modules
sudo dmesgKernel messages; Debian and Ubuntu require root

CPU

lscpu collects the data from /proc/cpuinfo and sysfs into one summary.

CommandDescription
lscpuArchitecture, model, cores, threads, caches, and flags
LC_ALL=C lscpu | grep 'Model name:'CPU model, when reported by the system
lscpu -eOne row per logical CPU with its core, socket, and online state
lscpu -CCache sizes per level
nprocProcessing units available to the current process
nproc --allAll installed processing units
grep -c ^processor /proc/cpuinfoCount logical CPUs
uname -mMachine architecture, x86_64 or aarch64; uname -p and uname -i usually print unknown
dpkg --print-architecturePackage architecture on Debian and Ubuntu, amd64 or arm64
getconf LONG_BITPrints 64 on a 64-bit system
sudo dmidecode -t processorSocket, 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.

CommandDescription
free -hTotal, used, free, and available RAM and swap
free -h -tAdd a Total row for RAM plus swap
free -h -s 2Repeat every 2 seconds; stop with Ctrl+C
grep -E 'MemTotal|MemAvailable' /proc/meminfoTotal and available RAM in kB
swapon --showActive swap files and partitions; no output means no swap
vmstat -y 2 5Five 2-second reports on memory, swap, I/O, and CPU. -y skips the since-boot report.
lsmemMemory block size and total online memory
sudo dmidecode -t memoryInstalled modules with size, type, speed, and empty slots

Disks and Filesystems

lsblk lists block devices. df reports space on mounted filesystems.

CommandDescription
lsblkDisks, partitions, sizes, and mount points
lsblk -fFilesystem type, label, UUID, and free space
lsblk -d -e7 -o NAME,SIZE,MODEL,TRANWhole disks with model and transport; -e7 hides loop devices
df -hSize, used, and available space per filesystem
df -hT /Type and space of the root filesystem
findmnt -T /etc/hostsSource and mount options for the filesystem containing the given path
sudo blkidUUIDs and filesystem types for /etc/fstab
sudo smartctl -i /dev/sdaDrive 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.

CommandDescription
sudo lshw -shortHardware summary grouped by class
lspciPCI devices: graphics, network, storage, and USB controllers
lspci -kPCI devices with the kernel driver in use
lspci | grep -iE 'vga|3d|display'Graphics card
lsusbUSB devices
cat /sys/class/dmi/id/product_nameMachine model, no root needed
cat /sys/class/dmi/id/sys_vendorManufacturer, no root needed
sudo dmidecode -s system-serial-numberSerial number
sudo dmidecode -t biosFirmware vendor, version, and release date
[ -d /sys/firmware/efi ] && echo UEFI || echo 'UEFI not detected'Check whether Linux detects an EFI boot
systemd-detect-virtVirtualization type, such as kvm or qemu; none on bare metal
nvidia-smiNVIDIA GPU, driver version, and CUDA version

Uptime and Boot

How long the system has been running and how it started.

CommandDescription
uptimeCurrent time, uptime, logged-in users, and load averages
uptime -pUptime in words, such as up 2 days, 10 hours, 55 minutes
uptime -sDate and time of the last boot
who -bLast boot time
journalctl --list-bootsBoots recorded in the journal, oldest first
last rebootReboot history; Debian 13 and Ubuntu 26.04 need wtmpdb, which starts recording at the next boot
systemd-analyzeHow long the last boot took
systemctl get-defaultDefault boot target, graphical.target or multi-user.target
wLogged-in users and what they are running

Hostname, Time, and Network

Identity and address details for the machine.

CommandDescription
hostnameHostname
hostnamectl hostnameStatic hostname on systemd systems
hostname -IIP addresses without interface names. Debian and Ubuntu omit loopback and IPv6 link-local addresses.
ip -br addrInterfaces with their state and addresses
timedatectlTime 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.

CommandDescription
inxi -bBasic report: system, machine, CPU, graphics, network, and drives
inxi -FzFull report with IP addresses and serial numbers filtered out
inxi -CCPU section only
fastfetchDistro logo next to OS, kernel, CPU, GPU, memory, and disk
fastfetch -l noneThe same summary without the logo
hostnamectlBuilt-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.

CommandPackage
lsb_releaselsb-release on Debian and Ubuntu; not in the Rocky 10 base repositories
lspcipciutils
lsusbusbutils
lshwlshw
dmidecodedmidecode
smartctlsmartmontools
lastwtmpdb on Debian 13 and Ubuntu 26.04; util-linux on Rocky 10
inxiinxi on Debian and Ubuntu; not in EPEL 10
fastfetchfastfetch; from EPEL on Rocky and RHEL 10

Use these guides for worked examples and full output.

GuideDescription
How to Check Linux VersionDistro and kernel version on any distribution
How to Check Your Ubuntu VersionUbuntu release from the terminal and the desktop
How to Check Your Debian VersionDebian point release and codename
How to Check the Kernel Version in Linuxuname, /proc/version, and installed kernels
CPU Info on Linuxlscpu, /proc/cpuinfo, and core counts
How to Check Memory Usage in Linuxfree, top, and /proc/meminfo
List Hardware in Linuxlsusb, lspci, and lshw
lsblk Command in LinuxBlock devices, filesystems, and UUIDs
smartctl Command in LinuxDrive identity and SMART health
df CheatsheetDisk space and inode usage