Listen to this Post
In 60 seconds, you can get a high-level idea of system resource usage and running processes by running the following ten commands:
1. `uptime`
Shows system load averages, indicating the number of tasks wanting to run.
uptime
2. `dmesg | tail`
Displays the last 10 system messages, useful for spotting errors affecting performance.
dmesg | tail
3. `vmstat 1`
Provides a summary of key server statistics, including memory, processes, and CPU activity.
vmstat 1
4. `mpstat -P ALL 1`
Breaks down CPU usage per core, helping identify single-threaded bottlenecks.
mpstat -P ALL 1
5. `pidstat 1`
Shows per-process CPU and memory usage, useful for tracking performance over time.
pidstat 1
6. `iostat -xz 1`
Monitors disk I/O performance, including read/write throughput and latency.
iostat -xz 1
7. `free -m`
Displays memory usage in megabytes, showing available and used RAM.
free -m
8. `sar -n DEV 1`
Measures network interface throughput (rxkB/s, txkB/s).
sar -n DEV 1
9. `sar -n TCP,ETCP 1`
Summarizes TCP metrics like retransmissions and connection rates.
sar -n TCP,ETCP 1
10. `top`
A dynamic overview of system processes, CPU, and memory usage.
top
You Should Know:
– `htop` (Enhanced `top` alternative):
sudo apt install htop && htop
– Check logged-in users:
who
– List open files by a process:
lsof -p <PID>
– Monitor real-time disk I/O:
iotop
– Check network connections:
netstat -tulnp
– Kill a misbehaving process:
kill -9 <PID>
What Undercode Say:
These commands provide a rapid USE Method (Utilization, Saturation, Errors) analysis for Linux systems. For deeper dives, consider:
– `strace` for system call tracing.
– `perf` for performance profiling.
– `iftop` for real-time bandwidth monitoring.
Expected Output:
A structured, actionable snapshot of system health, helping admins quickly diagnose bottlenecks.
Reference: Netflix Blog
References:
Reported By: Rocky Bhatia – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass ✅



