System monitoring in Linux and Unix environments encompasses real-time observation and historical analysis of system resources β CPU, memory, disk, network, and processes. From basic utilities like top and ps that ship with every distribution, to modern interactive tools like htop and btop, monitoring helps identify bottlenecks, diagnose failures, and optimize performance. Understanding load average (runnable + uninterruptible processes over 1, 5, and 15 minutes) differs from instantaneous CPU usage β the former reveals sustained pressure, the latter shows a snapshot. A key insight: iowait is not CPU time lost to waiting β it's idle time during which at least one I/O operation was pending, meaning high iowait with low CPU usage often indicates disk or network bottlenecks, not CPU saturation.
What This Cheat Sheet Covers
This topic spans 15 focused tables and 100 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
Table 1: Core Process Monitoring Commands
The first tools every sysadmin reaches for: real-time process viewers, snapshot tools, and utilities to find, filter, and inspect running processes. Mastering these covers the majority of day-to-day monitoring work without installing anything extra.
| Command | Example | Description |
|---|---|---|
top | β’ Real-time process viewer showing CPU, memory, load average β’ ships with all Unix-like systems β’ interactive keys M (sort by memory), P (CPU), k (kill), r (renice). | |
htop | β’ Enhanced color-coded interactive monitor β’ displays CPU cores individually, process tree ( F5), filtering (F4), sorting (F6)β’ requires installation but vastly more usable than top. | |
ps auxps -ef | β’ Snapshot of running processes β’ aux shows all users BSD-style, -ef shows full format Unix-styleβ’ not real-time β use for scripting and quick checks | |
atop 5 | β’ System-wide resource monitor updated every N seconds β’ logs historical data to /var/log/atop/β’ shows per-process disk I/O, network, CPU, memory β’ highlights saturated resources in red | |
btop | β’ Modern C++ successor to bashtop/bpytop β’ mouse support, themes, graphs for CPU/memory/disk/network β’ lightweight and highly responsive β’ best visual presentation of all CLI tools |