Htop Launch, Install, and Startup Flags

Core htop installation and launch commands, including startup options for delay, sorting, tree view, and PID filtering.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all
## Install and start
Install on Debian or Ubuntu
sudo apt-get update && sudo apt-get install -y htop

# Install htop from APT repositories.

Install on RHEL, CentOS Stream, Fedora
sudo dnf install -y htop

# Install htop with dnf.

Install on Arch Linux
sudo pacman -S htop

# Install htop with pacman.

Launch htop
htop

# Start the interactive process viewer.

Set update delay in tenths of a second
htop -d 20

# Control refresh cadence from the command line.

Show only selected PIDs
htop -p 1,1234,5678

# Restrict the list to one or more specific processes.

Show only one user's processes
htop -u www-data

# Start htop already filtered by user.

Sort by a specific column on startup
htop --sort-key=PERCENT_CPU

# Pick an initial sort key from the shell.

## Startup modes
Start directly in tree view
htop -t

# Show process hierarchy at launch.

Start in read-only mode
htop --readonly

# Disable process-changing actions.

Run without color
htop -C

# Use a plain monochrome display.

Start tree view with an explicit sort key
htop -t --sort-key=PERCENT_MEM

# Combine tree mode and sorting from the command line.

Focus on a process after startup
htop -p "$(pgrep -d, -f 'gunicorn|uvicorn')"

# Use PID filter for targeted monitoring of a service.

Run inside a container shell
docker exec -it my-container htop

# Inspect processes visible inside the current container namespace.

Recommended next

No recommendations yet.