toserveadmin.com~ %tail -f /var/log/knowledge/current.logχ ALL SYSTEMS NOMINAL EST. MMXVI REV 0.2.0
To Serve Admin
A practical cookbook for people who run servers
Linux · DevOps · Networking · Homelab · Cloud · Game Servers · AI Infra
§ refQuick reference101 commands
Linux Cheat Sheet
The commands you reach for to get through a box and find what’s wrong — process, disk, network, logs, containers. Print it, pin it, or bookmark it. Hover a row to copy nothing—just read; every command is copy-safe as written.
01 Finding your way / system facts
uname -a
Kernel, hostname, architecture — everything at a glance
hostnamectl
Hostname, OS, kernel, virtualization, machine-id
uptime
How long up + load averages (1/5/15 min)
lsb_release -a
Distro name and version
cat /etc/os-release
Distro details when lsb_release is missing
id && groups
Who am I, and which groups do I belong to
whoami && hostname -I
Current user and all IPs on the box
timedatectl
Time, timezone, NTP sync status
02 CPU / memory / load
top
Live process/CPU/memory — the reflex first look
htop
Friendlier top; sortable, tree view (F5), kill (F9)
free -h
Memory + swap in human units
vmstat 1
CPU/memory/IO per second — spot pressure
mpstat -P ALL 1
Per-core CPU usage (sysstat)
nproc
How many CPU cores are available
ps aux --sort=-%mem | head
Top memory hogs right now
ps aux --sort=-%cpu | head
Top CPU hogs right now
uptime; cat /proc/loadavg
Load averages — compare to core count
03 Disk / filesystem / inodes
df -h
Free space per mounted filesystem
df -i
Free inodes — the "disk full but df -h looks fine" case
du -sh *
Size of each item in the current dir
du -h --max-depth=1 / | sort -h
Find what is eating a filesystem, largest last
ncdu /
Interactive disk-usage explorer (install ncdu)
lsblk -f
Block devices, filesystems, mountpoints, UUIDs
mount | column -t
What is mounted, where, with which options
findmnt
Mount tree — clearer than mount
lsof +D /path
Which processes hold files under a directory
du -xh / | sort -h | tail -20
Biggest dirs on the root fs only (no crossing mounts)
04 Processes / signals
ps -ef
Full process list, parent PIDs
pgrep -a nginx
PIDs (and cmdline) matching a name
pstree -p
Process tree with PIDs
kill -TERM <pid>
Ask a process to stop cleanly
kill -9 <pid>
Force kill (last resort — no cleanup)
pkill -f "pattern"
Kill by matching the full command line
nice -n 10 cmd
Start a process with lower CPU priority
renice 10 -p <pid>
Re-prioritize a running process
strace -p <pid>
Trace syscalls of a running process
05 Ports / connections / sockets
ss -tulpn
Listening TCP/UDP ports + owning process — the modern netstat
ss -tn state established
All established TCP connections
lsof -i :443
What is using a specific port
fuser 8080/tcp
PID holding a TCP port
ip -br a
Interfaces + IPs, one line each
ip route
Routing table — where does traffic go
ping -c4 1.1.1.1
Basic reachability test
mtr 1.1.1.1
Live traceroute + loss per hop
dig +short example.com
Resolve a name fast
curl -I https://host
Headers only — check status without body
nc -zv host 22
Is a remote TCP port open
06 Logs / journald
journalctl -xe
Recent logs with explanations — first stop after a failure
journalctl -u nginx -f
Follow one service's logs live
journalctl -u ssh --since "1 hour ago"
Time-boxed service logs
journalctl -p err -b
Only errors, this boot
journalctl --disk-usage
How much space the journal uses
dmesg -T | tail
Kernel ring buffer (OOM kills, disk errors) with timestamps