htop
Interactive process viewer (better top).
Official WebsiteFeatures
Installation
brew install htopapt install htoppacman -S htopdnf install htopWhy Use htop?
Visual Resource Display
Display CPU, memory, and swap usage with colorful bar graphs. You can understand system status at a glance.
Interactive Operations
Select, sort, and kill processes with mouse and keyboard. Function keys provide intuitive operations.
Process Tree Display
Display parent-child relationships in tree format. Visually understand process relationships.
Fast Search and Filter
Find processes quickly with incremental search. Also supports filtering by user and process name.
Installation
# macOS (Homebrew)
brew install htop
# Ubuntu/Debian
sudo apt install htop
# Fedora
sudo dnf install htop
# Arch Linux
sudo pacman -S htop
# CentOS/RHEL (EPEL required)
sudo yum install epel-release
sudo yum install htopBasic Usage
# Launch htop
htop
# Show only processes for specific user
htop -u username
# Monitor specific PIDs
htop -p 1234,5678
# Launch in tree view
htop -t
# Specify delay time (in tenths of a second)
htop -d 10Screen Display
CPU Bar Color Meanings
Memory Bar Color Meanings
Keyboard Shortcuts
| Key | Function |
|---|---|
F1 / h | Show help screen |
F2 / S | Open settings screen |
F3 / / | Search process |
F4 / \ | Filter processes |
F5 / t | Switch to tree view |
F6 / < > | Select sort column |
F7 / [ | Decrease nice value (raise priority) |
F8 / ] | Increase nice value (lower priority) |
F9 / k | Send signal to process (Kill) |
F10 / q | Exit htop |
Space | Tag process (multiple selection) |
u | Filter by user |
H | Toggle user threads display |
K | Toggle kernel threads display |
P | Sort by CPU usage |
M | Sort by memory usage |
T | Sort by CPU time |
Process Management
Process Termination (Kill)
Select a process and press F9 to display the signal selection screen.
# Commonly used signals
15 SIGTERM # Normal termination (default, recommended)
9 SIGKILL # Force kill (when process is unresponsive)
2 SIGINT # Interrupt (equivalent to Ctrl+C)
1 SIGHUP # Reload configurationPriority Change (Renice)
Adjust nice value with F7/F8. Nice value ranges from -20 (highest priority) to 19 (lowest priority).
Batch Process Operations
Tag processes with Space to kill multiple processes together.
Settings and Customization
Open the settings screen with F2 to customize the following items.
Meters
Add, remove, and rearrange meters displayed in the header. CPU, memory, swap, load average, uptime, battery, and more.
Display Options
Configure tree view, shadow threads, custom thread names, color schemes, and more.
Columns
Add, remove, and reorder columns displayed in the process list.
Settings are saved to ~/.config/htop/htoprc.
Tips
1. Display Full Command Line
From F2 settings, select "Display options" and enable "Show custom thread names" to make long command line arguments more readable.
2. Use in Container Environments
When running htop inside a Docker container, add the --pid=host option to also display host processes.
3. System Monitoring via SSH
For remote server monitoring, you can start htop directly with ssh user@server htop.
4. Enable I/O Monitoring
On Linux, you can monitor disk I/O by adding IO_READ_RATE and IO_WRITE_RATE from F2 > Columns (may require root privileges).