← 返回命令列表

Linux command

htop 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Start htop

htop

Show processes for a specific user

htop -u [username]

Show only processes containing string

htop -F [string]

Start with tree view

htop -t

Sort by memory usage

htop -s PERCENT_MEM

Monochrome mode

htop -C

Show help

htop -h

说明

htop is an interactive, ncurses-based process viewer and system monitor designed as a more capable alternative to the traditional top command. Its full-screen interface displays per-core CPU utilization, memory, and swap usage as color-coded bar meters at the top, followed by a scrollable, sortable table of all running processes. Unlike top, htop supports full mouse interaction and intuitive keyboard shortcuts for everyday tasks. Users can filter the process list in real time (F4), search for processes by name (F3), and toggle a tree view (F5) that reveals parent-child process hierarchies. Sending signals to processes is straightforward -- pressing F9 presents a menu of signals (SIGTERM, SIGKILL, SIGHUP, etc.) to send to one or more tagged processes. Process priority (nice value) can be adjusted directly, and the setup screen (F2) allows full customization of which columns and meters are displayed, persisted across sessions.

参数

-u _user_, --user= _user_
Show only processes of specified user.
-p _pid_, --pid= _pid_
Show only specified PIDs.
-t, --tree
Start in tree view mode.
-s _column_, --sort-key= _column_
Sort by specified column.
-d _delay_, --delay= _delay_
Update interval in tenths of seconds.
-C, --no-color
Monochrome mode.
-F _string_, --filter= _string_
Show only processes containing string.
-H, --highlight-changes
Highlight new/changed processes.
--readonly
Disable process manipulation.

FAQ

What is the htop command used for?

htop is an interactive, ncurses-based process viewer and system monitor designed as a more capable alternative to the traditional top command. Its full-screen interface displays per-core CPU utilization, memory, and swap usage as color-coded bar meters at the top, followed by a scrollable, sortable table of all running processes. Unlike top, htop supports full mouse interaction and intuitive keyboard shortcuts for everyday tasks. Users can filter the process list in real time (F4), search for processes by name (F3), and toggle a tree view (F5) that reveals parent-child process hierarchies. Sending signals to processes is straightforward -- pressing F9 presents a menu of signals (SIGTERM, SIGKILL, SIGHUP, etc.) to send to one or more tagged processes. Process priority (nice value) can be adjusted directly, and the setup screen (F2) allows full customization of which columns and meters are displayed, persisted across sessions.

How do I run a basic htop example?

Run `htop` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -u _user_, --user= _user_ do in htop?

Show only processes of specified user.