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.

SysOps·20 commands·Last updated 2026-07-21
Back to SysOps

Process & Load 5

top -c
Real-time process and load view, -c shows full command
ps aux --sort=-%cpu | head
Sort by CPU to find top consumers
ps aux --sort=-%mem | head
Sort by memory to find memory hogs
kill -9 <pid>
Force kill, only after trying regular kill
uptime
Quick check of 1/5/15-minute load averages

Port & Network 5

ss -tlnp
List listening TCP ports and their processes
ss -tlnp | grep :8080
Check which process is using a specific port
curl -v http://127.0.0.1:8080
Verify local service reachability, see handshake details
ping -c 4 host
Test connectivity
dig +short example.com
Quick DNS resolution lookup

Disk & Memory 5

df -h
Check disk usage per partition
du -sh * | sort -rh | head
Find largest items in current directory
free -h
Check memory and swap usage
lsof +L1
Find deleted files still held by processes (disk full but no large file found)
iostat -x 1
Monitor disk I/O pressure, requires sysstat

Logs & Services 5

journalctl -u nginx -n 200 --no-pager
View recent systemd service logs
journalctl -f
Follow system logs in real time
systemctl status nginx
Check service status and recent log lines
tail -f /var/log/app.log
Follow application log file
dmesg -T | tail
View 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.

Official References

Commands are compiled from the official docs below. Click to verify the latest usage.

Maintained by LaoHand

Publicly updated on Jul 21, 2026, continuously proofread against official docs.

Contact Us

Wrong command or description? Send us corrections, business inquiries or product feedback by email.

Contact Us