Chapter 4: Linux Advanced Commands
4.12 Monitoring: top and htop
top is always available. htop is friendlier (colour, mouse, F-keys): sudo apt install -y htop (Ubuntu), sudo yum install -y htop (AL2023; on CentOS Stream enable EPEL first).
| In top | Action |
|---|---|
P / M |
Sort by CPU / memory |
k |
Kill a process (enter PID) |
1 |
Show each CPU core |
q |
Quit |
Key numbers: load average (should be below the number of vCPUs), %CPU, %MEM, RES memory, and wa (I/O wait — high means disk is slow).