What Is htop?
htop is an interactive process viewer for Linux. It provides a real-time, color-coded overview of CPU, memory, and process activity — a much better experience than the basic top command.
Installation
sudo apt install -y htop # Ubuntu/Debian
sudo dnf install -y htop # Rocky/Alma
Launch
htop
Understanding the Display
Header Section
- CPU bars — one bar per core. Colors: blue=low priority, green=normal, red=kernel
- Memory bar — green=used, blue=buffers, yellow=cache
- Swap bar — used swap space
- Tasks — total, running, sleeping processes
- Load average — 1, 5, and 15 minute load averages
Process List
| Column | Meaning |
|---|
| PID | Process ID |
| USER | Owner |
| PRI/NI | Priority / Nice value |
| VIRT | Virtual memory |
| RES | Physical RAM used |
| S | State (S=sleeping, R=running) |
| CPU% | CPU usage |
| MEM% | Memory usage |
| TIME+ | Total CPU time |
Keyboard Shortcuts
| Key | Action |
|---|
| F1 | Help |
| F2 | Setup (customize display) |
| F3 or / | Search for a process |
| F4 | Filter processes |
| F5 | Tree view |
| F6 | Sort by column |
| F9 | Kill a process |
| F10 or q | Quit |
| t | Toggle tree view |
| H | Hide user threads |
Tips
- Press
t to see process trees — helpful for understanding parent-child relationships - Press
M to sort by memory, P to sort by CPU - Use
F4 to filter for specific process names