htop
Quick Reference
Command Name:
htop
Category:
process management
Platform:
Linux/Unix
Basic Usage:
Common Use Cases
- 1
Process monitoring
Display dynamic information about running processes
- 2
Resource usage
Monitor CPU, memory, and I/O usage of processes
- 3
Troubleshooting
Diagnose issues with running processes
- 4
Scripting
Use in shell scripts to monitor and manage processes
Syntax
htop [options]
Options
Option | Description |
---|---|
-C, --no-color | Start htop in monochrome mode |
-d, --delay=DELAY | Set the delay between updates, in tenths of seconds |
-h, --help | Display help message and exit |
-p, --pid=PID[,PID...] | Show only the specified processes |
-s, --sort-key=COLUMN | Sort by specified column (use --sort-key=help for a column list) |
-t, --tree | Show processes in tree view |
-u, --user=USERNAME | Show only processes of a specific user |
-v, --version | Display version information and exit |
--readonly | Run htop in a read-only mode, disabling interactive commands that change processes |
Examples
How to Use These Examples
The examples below show common ways to use the htop
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
Basic Usage:
htop
Launch htop with the default display settings.
htop -u username
Display only processes owned by a specific user.
htop -p 1234,5678
Show only specific processes by their PIDs.
Display Options:
htop -t
Display processes in tree view mode, showing parent-child relationships.
htop -s PERCENT_CPU
Sort processes by CPU usage at startup.
htop -s PERCENT_MEM
Sort processes by memory usage at startup.