Linux Troubleshooting Cheatsheet - System Fault Diagnosis Command Reference
Essential Linux troubleshooting commands covering CPU, memory, disk, and network. Organized by scenario for on-site diagnosis — just copy and use.
Back to SysOpsProcess & Load 5
top -cReal-time process and load view, -c shows full command
ps aux --sort=-%cpu | headSort by CPU to find top consumers
ps aux --sort=-%mem | headSort by memory to find memory hogs
kill -9 <pid>Force kill, only after trying regular kill
uptimeQuick check of 1/5/15-minute load averages
Port & Network 5
ss -tlnpList listening TCP ports and their processes
ss -tlnp | grep :8080Check which process is using a specific port
curl -v http://127.0.0.1:8080Verify local service reachability, see handshake details
ping -c 4 hostTest connectivity
dig +short example.comQuick DNS resolution lookup
Disk & Memory 5
df -hCheck disk usage per partition
du -sh * | sort -rh | headFind largest items in current directory
free -hCheck memory and swap usage
lsof +L1Find deleted files still held by processes (disk full but no large file found)
iostat -x 1Monitor disk I/O pressure, requires sysstat
Logs & Services 5
journalctl -u nginx -n 200 --no-pagerView recent systemd service logs
journalctl -fFollow system logs in real time
systemctl status nginxCheck service status and recent log lines
tail -f /var/log/app.logFollow application log file
dmesg -T | tailView kernel messages for OOM and hardware errors
💡 Tips
- Disk shows full but no large file found — a process likely holds a deleted file. Use lsof +L1 to locate it, then restart the process.
- kill sends SIGTERM by default for graceful shutdown — try regular kill first, only use kill -9 if stuck.
- "Out of memory: Killed process" in dmesg means OOM, not a crash in the application itself.