top works. htop works better. It’s colorful, interactive, and actually pleasant to use. Here’s how to get the most from it.
Installation
| |
The Interface
Launch with htop. You’ll see:
Top section:
- CPU bars (one per core)
- Memory and swap usage
- Tasks, load average, uptime
Process list:
- PID, user, CPU%, MEM%, time, command
Bottom:
- Function key shortcuts
Essential Shortcuts
| Key | Action |
|---|---|
F1 or h | Help |
F2 or S | Setup menu |
F3 or / | Search |
F4 or \ | Filter |
F5 or t | Tree view |
F6 or > | Sort by column |
F9 or k | Kill process |
F10 or q | Quit |
Space | Tag process |
U | Untag all |
u | Filter by user |
Tree View
Press F5 to see process hierarchy:
This shows parent-child relationships — crucial for understanding what spawned what.
Sorting
Press F6 to sort by:
- CPU% — What’s eating CPU?
- MEM% — Memory hogs
- TIME+ — Long-running processes
- PID — Process ID order
Or click column headers directly.
Filtering and Search
Search (F3): Find process by name, jumps to first match.
Filter (F4): Shows only matching processes. Type python to see only Python processes.
Clear filter with F4 → Esc.
Killing Processes
- Navigate to process
- Press
F9(ork) - Select signal:
15 SIGTERM— Graceful shutdown9 SIGKILL— Force kill
- Press Enter
Or tag multiple processes with Space, then kill all tagged.
User Filter
Press u to filter by user. Useful for seeing just your processes or a service account’s.
Column Customization
Press F2 → Columns to add/remove:
Useful additions:
- IO_READ/IO_WRITE — Disk I/O
- STARTTIME — When process started
- PROCESSOR — Which CPU core
- STATE — R (running), S (sleeping), D (disk wait), Z (zombie)
CPU and Memory Meters
In setup (F2 → Meters), customize the top display:
Options include:
- CPU average vs per-core
- CPU frequency
- Tasks (running, total)
- Load average
- Hostname
- Clock
Practical Scenarios
Find Memory Hog
- Launch
htop - Press
F6→ MEM% - Top processes are your culprits
Find Runaway CPU
- Launch
htop - Press
F6→ CPU% - Watch for sustained 100%
Kill Stuck Process
F3to search- Navigate to process
F9→9(SIGKILL) → Enter
Monitor Specific App
| |
Shows only Python processes.
See What User is Running
| |
Or press u inside htop and select user.
Config File
htop saves settings to ~/.config/htop/htoprc. Share this file across machines for consistent setup.
Key settings:
| |
htop vs top
| Feature | top | htop |
|---|---|---|
| Colors | No | Yes |
| Mouse support | No | Yes |
| Horizontal scroll | No | Yes |
| Tree view | Limited | Full |
| Kill from UI | Awkward | Easy |
| Filter | No | Yes |
| Usability | Meh | Great |
Use top when htop isn’t installed. Otherwise, htop every time.
Alternatives
- btop — Even prettier, with graphs
- glances — System monitoring dashboard
- atop — Historical logging
- bottom — Rust rewrite, very fast
But htop is the universal standard. It’s everywhere and it works.
Quick Start
| |
htop is the process manager you’ll actually enjoy using. Install it everywhere.
Computing Arts covers the tools that make production bearable. More at computingarts.com.