Editorial review date: October 23, 2026. Reliable Linux troubleshooting is a sequence of observations, not a collection of commands to run blindly. When a server becomes slow, a service stops responding, or users cannot reach an application, start by defining the failed operation and its boundaries. A command that changes network settings or repairs a filesystem before evidence is collected can make a recoverable incident worse. This guide turns the original network, startup, storage and performance topics into a practical diagnostic workflow with mostly read-only commands.
Define the failure and preserve evidence
Record when the symptom began, who is affected, which host or container is involved, and what changed just beforehand: a deployment, patch, storage migration, firewall rule, DNS update or certificate renewal. Confirm the system’s clock and time zone so logs can be correlated. If a production host is unstable, assign an incident owner and avoid running several uncontrolled recovery attempts simultaneously.
Start with commands that describe the environment rather than modify it:
uname -a
cat /etc/os-release
uptime
who -b
These establish kernel version, distribution, uptime and recorded boot time. Output may include hostnames or user information; redact such details before sharing them externally. A log message is an observation, not proof of root cause. Compare it with application errors, changes and metrics at the same time.
Trace the network from local state outward
When an application cannot connect, distinguish a failed interface from a missing route, broken DNS, an unresponsive service and a filtering policy. On a Linux system with the iproute2 tools, inspect the local address and route:
ip -brief address
ip route
ip route get 1.1.1.1
The route lookup shows how the kernel would try to reach the example address; it is not proof that a packet can complete the path. Check the real destination address and local network policy. ICMP may be blocked, so a failed ping alone does not prove that HTTPS or another application protocol is unavailable.
For name resolution, compare a DNS query with the same service accessed by its verified IP address. On systems with appropriate tools, getent hosts example.com demonstrates the system name-service path, while resolvectl status describes systemd-resolved configurations where that service is present. Do not assume every distribution uses the same resolver. If name resolution succeeds but the application still fails, inspect the listening service and firewall path.
ss -ltn
ss -tun
The first command lists listening TCP sockets; the second provides broader TCP/UDP socket information. A port shown as listening locally does not establish reachability through a cloud security group, external firewall, ingress proxy or NAT. Verify the endpoint from an authorized client path. Avoid large unrestricted network scans when troubleshooting a single service.
Look at service health and logs before restarting
On a system using systemd, systemctl status and journalctl are valuable read-only entry points. Substitute the actual service unit:
systemctl status nginx.service --no-pager
journalctl -u nginx.service -b --no-pager -n 100
journalctl -b -p warning --no-pager -n 100
These examples inspect current service state, recent logs for that service in the current boot, and high-priority system messages. They will not be applicable unchanged where nginx is not installed or where a different init system runs. An inactive service may be expected on one host and a critical failure on another; first confirm its designed role.
Do not restart a failed database or web service merely to hide an error. Record the service exit status, recent changes, permissions, certificate state and relevant logs first. If a restart is justified, understand its impact on active sessions and dependencies, schedule it within incident change controls, and capture the post-restart result.
Separate disk capacity, I/O health and filesystem integrity
Disk space problems are common but have several causes. df -h reports filesystem capacity; df -i shows inode use; lsblk -f describes devices and filesystems. A filesystem with free bytes but exhausted inodes can still reject new files. Large log growth may be a symptom of the same application failure that users are reporting, not a separate reason to delete logs before analysis.
df -h
df -i
lsblk -f
journalctl -k -b --no-pager -n 100
Kernel logs may reveal I/O timeouts or device resets. Never apply fsck with repair options to a live mounted production filesystem without identifying its filesystem type, required offline conditions and a current recoverable backup. Some filesystems use different repair utilities. Storage with suspected hardware faults should be evaluated for safe data recovery before repeated write-intensive tests.
Differentiate CPU, memory pressure and blocked I/O
A high load average does not necessarily mean CPU exhaustion. Linux load can include tasks waiting in uninterruptible I/O; compare CPU utilization with memory, swap activity and storage latency. Use top or ps to identify the processes consuming resources. free -h describes memory categories; the available-memory figure is often more helpful than interpreting cached memory as entirely unavailable.
free -h
ps -eo pid,comm,%cpu,%mem --sort=-%cpu | head
vmstat 1 5
These commands are observational. The five-sample vmstat output can help identify swap or I/O pressure, but the first sample may represent averages since boot rather than a single interval. If latency remains unexplained, correlate with application metrics and storage-platform telemetry rather than immediately changing kernel tuning parameters.
Memory pressure from a container differs from host memory exhaustion: container cgroup limits and out-of-memory events must be checked separately. Similarly, a service using most host CPU may be performing expected batch work rather than misbehaving. Establish a working baseline and user impact before ending processes or changing limits.
Diagnose startup failures cautiously
If a machine reaches emergency mode, record the exact boot error. A missing mount, an invalid /etc/fstab entry, a failed dependency, a disk problem or a recent kernel change may be responsible. On a machine that boots far enough to run systemd, systemctl --failed and journalctl -b help identify failed units. On a system that cannot boot at all, use the vendor’s supported recovery media and documented procedure for the firmware and filesystem involved.
Do not copy a generic bootloader reinstall sequence across UEFI, BIOS, Secure Boot and multiple distributions. A command appropriate for one can be destructive on another. Boot recovery should identify the actual root filesystem, boot partition, firmware mode and encryption requirements, then preserve data and capture evidence before any repair.
Use a decision record instead of random fixes
A useful incident note includes: reported symptom, reproducing user request, affected scope, exact host and versions, time of onset, recent changes, initial observations, evidence contradicting each hypothesis, each authorized change, results and rollback. For a DNS failure, a successful address-based connection plus failed name resolution is stronger evidence than repeated restarts. For an I/O failure, kernel timeouts combined with a storage event are stronger than the perception that ‘Linux is slow.’
Bring the process back to the user: verify the original application operation from a real client after the fix, and check it again after the system has been stable for a meaningful period. A monitoring alert clearing is not always the same as user recovery.
Worked example: a website appears down for one office
Suppose one office cannot open an internal HTTPS service, while another office can. The first decision is scope: the service is likely running somewhere because some clients succeed. Compare DNS answers for the same hostname on both networks and record the requested address. If they differ, investigate resolver configuration, split-horizon DNS, stale cache or a wrongly published endpoint before restarting the web server.
If both offices resolve the same address but only one can connect, test the intended TCP port from each authorized location, then compare route and firewall evidence. A successful TCP connection does not prove TLS or application authorization works. Certificate trust, hostname verification, reverse-proxy routing and account permissions can still fail after transport succeeds. Record the exact HTTP status or TLS error rather than summarizing every failure as ‘network down.’
If neither office can complete a request, move to the application and service host. Check whether the listener exists, whether systemd reports a failed unit, and whether recent logs correlate with the first unsuccessful request. During an incident, one carefully timed request with matching service logs can reveal more than hundreds of generic pings. Confirm restoration from the originally affected office, not just from a local shell on the server.
Package-level tools also differ across distributions. A missing diagnostic executable should not trigger an unrelated software installation on a production incident host without approval. Use the tools already available, the vendor’s supported equivalents, or an approved diagnostics image. Record privilege requirements: some logs and socket details need elevated read access, but a generic ‘run everything as root’ policy increases operational risk.
In containerized environments, first distinguish a failed host service from an unhealthy container or application pod. A container restart can conceal an image configuration or persistent-volume problem rather than fix it. Correlate the container orchestration event time with host network, storage and application logs, and preserve identifiers before the workload is rescheduled.
The effective Linux troubleshooter works from the outside in: define what failed, inspect read-only state, isolate a layer, test a specific hypothesis, and only then apply a controlled change. The commands above are examples to adapt to an actual distribution and incident; they are not a universal recovery script.