It's midnight, monitoring has sent an alert, and you've SSH'd into the server. The question isn't "how do I troubleshoot Linux"; the question is, for this specific symptom, which command with which flag do you run, and how do you read its output. This text is that cheat sheet: symptom, command, interpretation. Copy and run.
Load average is high but the CPU is idle
The first thing most people do is top and then they get confused: load is at 40 and the CPU is around 10 percent. In Linux, load average is the number of processes that are running or waiting on I/O, so a high number doesn't necessarily mean the CPU is the bottleneck.
uptime
vmstat 1 5
iostat -xz 1
In the vmstat output, the r column is the run queue and the b column is the number of processes blocked on I/O. If b is high, the problem is the disk, not the processor. In iostat -xz, look at the %util and await columns; an await above 20 milliseconds on an ordinary SSD means a queue has formed. On NVMe this number should be single-digit.
If the disk is the culprit, iotop -oPa shows which process is reading and writing. Not top.
The disk is full but df doesn't show anything strange
There are two classic cases and both have the same symptom: writes fail, the logs say No space left on device, but df -h says 60 percent is free.
df -h
df -i
lsof +L1 | head -20
First case: inodes are exhausted. Run df -i; if IUse% is at 100, you have millions of small files (sessions, cache files, the mail queue). Second case: a file has been deleted but a process still holds its file descriptor open, so the blocks haven't been freed. lsof +L1 shows exactly these with a NLINK column of zero. The solution isn't deleting the file; it's restarting that service.
And if the / partition is full, before deleting anything, check whether you have an extra disk; the method for attaching and mounting an additional disk in Linux is laid out step by step in the additional disk mounting documentation and is safer than randomly moving folders around.
The service won't come up: which log do I start with
The correct order is this, not guessing:
systemctl status NAME --no-pager -lfor the status and the last log linesjournalctl -u NAME -n 100 --no-pagerfor the last hundred lines of that unitjournalctl -p err -b --no-pagerfor all errors from this boot
The error status=203/EXEC means systemd couldn't find the executable or it lacks execute permission; it's not a config problem. The error status=1/FAILURE means the program itself exited with code 1 and you need to read its own log. Don't confuse these two.
When the service won't come up at all and SSH doesn't respond either, commands are useless; there you need to use server rescue mode and then take the safe order for stopping and bringing services back from the server restart guide.
The port isn't open: ss or netstat?
netstat isn't installed by default on many newer distributions and net-tools is deprecated. Use ss:
ss -tulpn
ss -s
ss -tn state established '( dport = :443 )' | wc -l
Read the Local Address:Port column carefully. 127.0.0.1:3306 means MySQL is only listening locally and won't accept connections from outside; this is different from "the port is closed." If the address was 0.0.0.0 or * and you still couldn't get a response from outside, the culprit is the firewall, not the service:
iptables -S
nft list ruleset
firewall-cmd --list-all
And remember that on many servers there's also an external firewall layer that isn't visible with iptables inside the server. If the port is open inside but not outside, check that layer first.
DNS resolves but the site won't open
Here you need to separate whether the problem is the name or the connection:
dig +short A example.com @1.1.1.1
dig +trace example.com
curl -vI https://example.com --resolve example.com:443:203.0.113.10
--resolve pins the name to a specific IP and bypasses local DNS. If the site opens with this command and not without it, the problem is DNS, not the web server. If curl gets stuck on TLS, use openssl s_client -connect example.com:443 -servername example.com to see what the certificate says; the errors certificate has expired or unable to get local issuer certificate show up right there.
Symptom-to-command table
| Symptom | First command | What to look at |
|---|---|---|
| General slowness, no errors | vmstat 1 5 | The r and b columns |
No space left on device | df -h; df -i | Use% and IUse% |
| File deleted, space not freed | lsof +L1 | Processes with NLINK=0 |
| Service won't start | journalctl -u NAME -n 100 | The status= code |
| Port doesn't respond from outside | ss -tulpn | Local Address |
| Sporadic hardware outages | dmesg -T | tail -50 | oom-killer, I/O error |
| Sudden memory usage spike | free -m; ps aux --sort=-rss | head | The RES column |
Here's where people go wrong
The most common mistake I've actually seen: someone looks at dmesg, sees the line Out of memory: Killed process 1234 (php-fpm), and immediately adds swap. The result is that the OOM-killer no longer kills that process, the system instead starts thrashing, and the whole server becomes unusable. The symptom is clear too: high load, CPU mostly in wa, and SSH responding with a delay of several seconds.
Swap is good for a safety margin, not for hiding a memory shortage. Before adding it, run ps aux --sort=-rss | head and see what's eating the memory. If PHP-FPM with a high pm.max_children is the culprit, the answer is in its config, not in swap. If you genuinely have a memory shortage, upgrading resources is more correct than patching; cloud server lets you raise resources without reinstalling.
What to prepare in advance
These commands only help when they've been run beforehand. Set up external monitoring and alert thresholds before the incident; the details are in the server monitoring guide. Also actually test your automated backup once a month, because a backup that failed silently is the worst kind of backup; the method for checking is explained in verifying automated backups.
And if you have a physical server and are looking for hardware-level commands like smartctl -a /dev/sda or ipmitool sel list, you have full access on a dedicated server; on virtualized environments these commands usually return nothing.
If you've just received your server and want to set things up correctly from the start, Linux hosting is a good starting point; but more important than that is the habit of reading output. Don't memorize the command; learn which column to look at.
Frequently asked questions
What's a good load average?
The precise benchmark is the number of CPU cores. If nproc returns 4, a sustained load above 4 means a queue has formed and you need to find the cause. A number below the core count is usually not a problem, but high load with an idle CPU almost always means I/O wait.
Why does df say there's space but I can't create a file?
Most likely the inodes are exhausted. Check with df -i; if IUse% is at 100, the problem is the number of files, not their size. Folders like cache, sessions, and the mail queue are usually the culprits.
What's the difference between ss and netstat?
ss is the successor to netstat and responds faster on newer kernels because it reads directly from netlink. On many distributions netstat isn't installed by default. To see open ports and the process that owns them, ss -tulpn is enough.
How do I tell whether the problem is DNS or the web server?
With curl -vI https://example.com --resolve example.com:443:IP, bypass the name. If you get a response with this command and not without it, the problem is DNS. If both fail, go to the web server and firewall.