htop Command Guide for a Human-Friendly Process Monitor
This guide helps you understand and use the htop command, the interactive process viewer that makes top feel modern.
What is htop, and Why Use It?
The htop command is an improved, interactive process viewer: color-coded usage bars, horizontal and vertical scrolling, mouse support, easy process searching, and tree view of parent-child relationships. It is not installed by default on most systems — you install it like any other package — but once you have it, going back to plain top feels like downgrading.
Why Learn htop?
- Usability: Colors, bars, and single-key actions make the system easy to read at a glance.
- Tree view: See which process spawned which, instead of a flat alphabetical list.
- Mouse and scrolling: Scroll the full process list instead of being stuck with the first screenful.
- It is on every server you will meet: Once installed, it is the first thing experienced admins open.
htoptakes the same datatopshows and makes it feel like a dashboard instead of a spreadsheet.
1. Start htop
htop
- If it is missing, install it first — see the Package Management section of this book for your distro;
- The screen shows CPU and memory bars at the top and the process table below;
- Press
F1for help,qorF10to quit.
2. Use the Search
F3 search for a process by name
F4 filter to matching processes
/ same as F3 in newer versions
- Press
F3and start typing — matches are highlighted as you type; Enterjumps to the next match;- Press
F4instead ofF3to hide everything that does not match — a live filter, similar togrepon the process list.
3. Sort and Scroll
< and > change the sort column
M sort by %MEM (P for %CPU)
T sort by TIME
Arrow keys scroll the process list
Home / End jump to the top or bottom
- The sort column can be any usage metric;
- Arrow keys scroll the full list — no more first-screen-only views;
Hhides user threads,Khides kernel threads, for a cleaner list.
4. Kill, Renice, and Trace from the Keyboard
F9 send a signal (kill menu)
F10 quit
- Press
F9to open the signal menu — choose signal 15 (SIGTERM) politely, 9 (SIGKILL) forcibly; F9works on the highlighted process, or on several at once if you have marked them;- Press
cto toggle the full command path, so you see exactly which binary each process runs.
5. Show the Process Tree
F5 tree view
- The tree view indents every child under its parent;
- This is how you see that a web server spawned its workers, or that a script started a chain of commands;
- Press
F5again for the flat view.
6. Save the Layout for Next Time
htop
# choose "Setup" from F1 (Setup), adjust options, then
# "Save setup to ~/.config/htop/htoprc"
htopremembers nothing by default;- The Setup screen (inside the F1 help) lets you set the sort column, colors, and tree options;
- Saving the setup makes every future session start the way you like.
Common Pitfalls
- Expecting it to be installed:
htopis a package, not a given — on a fresh server, install it before you need it, not during an outage. - Trusting colors blindly: The red and magenta bars are configurable; a color does not always mean “bad.”
- Forgetting it is interactive:
htophas no batch mode liketop -b— for scripted monitoring, usetop -bor plainps.
Related Pages
| Page | Description |
|---|---|
top | The classic monitor htop improves on |
ps | The snapshot view for scripts |
kill | Stop processes — also reachable via F9 |
renice | Change priority of a process |
htop Cheatsheet
| Task | Command |
|---|---|
| Start | htop |
| Search a process | F3 or / |
| Filter to matches | F4 |
| Tree view | F5 |
| Kill / signal menu | F9 |
| Sort by CPU / memory | P / M |
| Show full command path | c |
| Help | F1 |
| Quit | F10 or q |