Use with the Linux series starting at A short history of Unix and Linux. Narrative detail lives in the chapter links below each section.
System and services
| Command | Purpose |
|---|---|
systemctl status UNIT |
Service state and recent log lines |
systemctl enable --now UNIT |
Enable and start |
systemctl list-units --type=service |
Running services |
journalctl -u UNIT -b |
Logs for unit, current boot |
journalctl -xe |
Recent errors with hints |
See Booting Linux and systemd.
Boot and kernel
| Command | Purpose |
|---|---|
uname -r |
Running kernel release |
dmesg | less |
Kernel ring buffer |
sudo update-grub |
Regenerate GRUB config |
sudo update-initramfs -u -k all |
Rebuild initramfs |
See The Linux kernel and Booting Linux and systemd.
Files and disks
| Command | Purpose |
|---|---|
df -hT |
Filesystem space and types |
findmnt |
Mount tree |
lsblk -f |
Block devices and UUIDs |
ls -li PATH |
Inodes and permissions |
See Linux filesystems.
Processes
| Command | Purpose |
|---|---|
ps aux |
Process list |
pstree -p |
Process tree with PIDs |
kill -TERM PID |
Polite termination |
ss -tulpn |
Listening sockets |
See Processes and inter-process communication.
Packages (Debian)
| Command | Purpose |
|---|---|
sudo apt update |
Refresh package index |
sudo apt upgrade |
Upgrade installed packages |
apt search PATTERN |
Search package names |
dpkg -L PACKAGE |
Files from a package |
apt install -t SUITE-backports PKG |
Install from backports |
See Package management on Debian.
Users and permissions
| Command | Purpose |
|---|---|
id |
Current UID, GIDs, groups |
chmod MODE FILE |
Change permission bits |
chown USER:GROUP FILE |
Change owner and group |
umask |
Show creation mask |
sudo -l |
Allowed sudo commands |
See Users, groups and permissions in Linux.
Network
| Command | Purpose |
|---|---|
ip addr show |
Addresses per interface |
ip route show |
Routing table |
ss -tulpn |
Open ports and processes |
resolvectl status |
DNS configuration (systemd-resolved) |
sudo nft list ruleset |
Active nftables rules |
See Networking on Linux.
Scheduling
| Command | Purpose |
|---|---|
crontab -e |
Edit user cron table |
systemctl list-timers --all |
systemd timer schedule |
atq |
List queued at jobs |