How to Monitor System Resources on Linux
Check CPU, memory, disk, and network usage on Linux using top, htop, free, df, and other essential monitoring commands.
Monitoring Resources on Linux
Knowing how to check what your system is doing is a fundamental Linux skill. Whether your machine is running slow, a process is eating RAM, or your disk is filling up, these tools give you the answers in seconds.
top — Real-Time Process Monitor
top is available on every Linux system and shows a live list of running processes sorted by CPU usage:
top
Key columns: %CPU (processor usage), %MEM (memory), RES (actual RAM used). Press q to quit, k to kill a process by PID, M to sort by memory.
htop — The User-Friendly Alternative
htop is a more visual, color-coded version of top with mouse support. Install it first:
sudo apt install htop # Ubuntu/Debian
sudo dnf install htop # Fedora
Then run htop. You get per-CPU bars, a memory bar, tree view of processes, and function key shortcuts at the bottom. Press F9 to kill a selected process.
free — Check Memory Usage
See total, used, and available RAM at a glance:
free -h
Sample output:
total used free shared buff/cache available
Mem: 15Gi 4.2Gi 8.1Gi 512Mi 3.1Gi 10.8Gi
Swap: 2.0Gi 0B 2.0Gi
The available column is the most important — it shows how much RAM new processes can actually use.
df — Check Disk Space
df -h
Shows how full each mounted filesystem is. Watch for any partition above 85% usage — that is your warning sign.
iostat and vmstat — Deeper Diagnostics
For disk I/O and CPU/memory stats over time:
# Install sysstat first
sudo apt install sysstat
# Disk read/write rates, 1-second intervals
iostat -x 1
# CPU, memory, swap activity
vmstat 1
Checking Network Usage
# Bandwidth per interface
ip -s link
# Live network monitor (install nethogs)
sudo apt install nethogs
sudo nethogs
Quick Reference
top/htop— CPU and process overviewfree -h— RAM and swap usagedf -h— disk space by filesystemiostat -x 1— disk I/O ratessudo nethogs— network usage per process
Start with htop for a quick health check — it is the most informative single command for everyday Linux monitoring.