Linux
Command
Library
Basics
Tips
Commands
System information
OS & Kernel
Which distribution, which kernel, and how long has it been running?
$
uname
-a
$
hostnamectl
$
lsb_release
-a
$
cat
/etc/os-release
$
uptime
Pretty system overviews for screenshots and quick orientation.
$
fastfetch
$
neofetch
$
inxi
-Fz
CPU
lscpu
summarizes model, cores, and features; /proc/cpuinfo has the raw per-core details.
$
lscpu
$
cat
/proc/cpuinfo
Current CPU load:
top
in batch mode for a one-shot value,
mpstat
for per-core statistics,
vmstat
for a rolling view.
$
top
-bn1 |
grep
"Cpu(s)"
$
mpstat
1 5
$
vmstat
1
Memory
free -h
answers the common question; /proc/meminfo has every detail.
$
free
-h
$
cat
/proc/meminfo
$
vmstat
In
free
, look at the "available" column, not "free": Linux uses spare RAM for disk cache and releases it when programs need it.
Processes
Snapshot with
ps
, live view with
top
or one of its friendlier successors.
$
ps
aux
$
ps
aux --sort=-%mem |
head
$
top
$
htop
$
btop
$
atop
Disks & Partitions
Free space per filesystem, block devices as a tree, and partition tables (root required for fdisk/parted).
$
df
-h
$
duf
$
lsblk
-f
$
fdisk
-l
$
parted
-l
Hardware
List devices by bus, or get the full inventory including model numbers.
$
lspci
$
lsusb
$
lshw
-short
$
dmidecode
-t memory
Temperatures and fan speeds (run
sensors-detect
once first).
$
sensors
Battery
upower
reports detailed battery state;
acpi
gives the one-line answer. The raw values live in /sys.
$
acpi
-b
$
upower
-i $(
upower
-e |
grep
BAT)
$
cat
/sys/class/power_supply/BAT*/capacity
Bluetooth
bluetoothctl
is the current tool;
hciconfig
is deprecated but still found on older systems.
$
bluetoothctl
show
$
bluetoothctl
devices
$
hciconfig
-a
Network Interfaces
$
ip
a
$
ifconfig
-a
Kernel & Boot Messages
dmesg
prints the kernel ring buffer (root on most distributions);
journalctl -b
shows everything logged since this boot.
$
dmesg
$
dmesg
-w
$
journalctl
-b
$
lsmod
Copied to clipboard