Linux Troubleshooting Cheatsheet - System Fault Diagnosis Command Reference

When load spikes, a port stops responding, or disk space alarms, drill down layer by layer with this list — processes, network, disk, memory, then logs — each immediately usable. It deliberately flags common misdiagnoses, from deleted files still held open to telling OOM kills from ordinary crashes, so you hit the root cause instead of chasing the wrong lead.

SysOps·20 commands·Last updated 2026-07-21
linuxTroubleshootingProcessesPorts

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

Each command links to its official documentation below, so you can verify the latest usage and read deeper.

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