Terminal GuideTerminal Guide
htop icon

htop

System Monitoring
macOSLinux
C

Interactive process viewer (better top).

Official Website

Features

InteractiveProcess TreeCPU/Memory GraphsSearch & Filter

Installation

Homebrew
brew install htop
APT (Debian/Ubuntu)
apt install htop
Pacman (Arch)
pacman -S htop
DNF (Fedora)
dnf install htop

Why 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

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 htop

Basic Usage

basic-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 10

Screen Display

CPU[|||||||||||||||| 32.5%] Tasks: 142, 524 thr; 2 running CPU[||||||||||| 18.3%] Load average: 1.23 0.98 0.87 Mem[|||||||||||||||||||||||||| 5.2G/16.0G] Uptime: 3 days, 02:15:42 Swp[ 0K/2.00G] PID USER PRI NI VIRT RES SHR S CPU% MEM% TIME+ Command 1234 root 20 0 2048M 512M 128M S 25.0 3.2 12:34.56 /usr/bin/node app.js 5678 www-data 20 0 1024M 256M 64M S 15.2 1.6 8:21.33 nginx: worker process 9012 mysql 20 0 4096M 2G 128M S 12.1 12.5 45:12.78 /usr/sbin/mysqld 3456 user 20 0 512M 64M 32M S 5.5 0.4 2:15.00 vim ~/.bashrc 7890 root 20 0 256M 32M 16M S 2.1 0.2 0:45.12 /usr/sbin/sshd F1Help F2Setup F3Search F4Filter F5Tree F6SortBy F7Nice- F8Nice+ F9Kill F10Quit

CPU Bar Color Meanings

Green: User processes (normal priority)
Blue: Low priority processes (positive nice value)
Red: Kernel processes (system)
Cyan: Virtualization-related

Memory Bar Color Meanings

Green: Used memory
Blue: Buffers
Yellow: Cache

Keyboard Shortcuts

KeyFunction
F1 / hShow help screen
F2 / SOpen settings screen
F3 / /Search process
F4 / \Filter processes
F5 / tSwitch to tree view
F6 / < >Select sort column
F7 / [Decrease nice value (raise priority)
F8 / ]Increase nice value (lower priority)
F9 / kSend signal to process (Kill)
F10 / qExit htop
SpaceTag process (multiple selection)
uFilter by user
HToggle user threads display
KToggle kernel threads display
PSort by CPU usage
MSort by memory usage
TSort by CPU time

Process Management

Process Termination (Kill)

Select a process and press F9 to display the signal selection screen.

signals
# 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 configuration

Priority 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).

Written by Dai AokiPublished: 2026-01-20

Related Articles

Explore More