LinuxCommandLibrary

htop

Monitor system processes interactively

TLDR

Start htop

$ htop
copy

Start htop displaying processes owned by a specific user
$ htop [[-u|--user]] [username]
copy

Display processes hierarchically in a tree view to show the parent-child relationships
$ htop [[-t|--tree]]
copy

Sort processes by a specified sort_item (use htop --sort help for available options)
$ htop [[-s|--sort]] [sort_item]
copy

Start htop with the specified delay between updates, in tenths of a second (i.e. 50 = 5 seconds)
$ htop [[-d|--delay]] [50]
copy

See interactive commands while running htop
$ <?>
copy

Switch to a different tab
$ <Tab>
copy

Display help
$ htop [[-h|--help]]
copy

SYNOPSIS

htop [-d delay] [-s column] [-u user] [-p pid,pid,...] [-v]

PARAMETERS

-d delay
    Set the delay between updates, in tenths of seconds.

-s column
    Sort by column (try --sort-key=help for a list).

-u user
    Show only processes of a given user.

-p pid,pid,...
    Show only the given PIDs.

-v
    Display version information and exit.

DESCRIPTION

htop is an interactive process viewer for Linux. It is a text-mode application and an alternative to the standard 'top' program.

htop displays a frequently updated list of the processes running on a system, normally ordered by CPU usage. Unlike 'top', it provides a full list of processes running rather than the top CPU-consuming ones. It also allows you to perform actions on processes, such as killing or reniceing them, without needing to type the PID. htop uses color and visual cues to provide more informative output and offers features like horizontal and vertical scrolling, and the ability to kill multiple processes at once. Its interactive nature and ease of use make it a favorite among system administrators and developers for monitoring system resource usage and managing processes efficiently.

INTERACTIVE COMMANDS

htop is designed to be interactive. Common commands include using the arrow keys to navigate the process list, F6 to sort by different columns, F9 to send a signal to a process (typically SIGKILL to terminate), and F5 to view the process tree. Pressing 'h' will bring up the help screen.

CUSTOMIZATION

htop's appearance and behavior can be customized via its configuration file, typically located at ~/.config/htop/htoprc. This allows users to modify colors, display options, and sort order, among other settings, to suit their preferences.

HISTORY

htop was created by Hisham Muhammad in 2004 as an improved alternative to the standard 'top' command.

Its development focused on enhancing interactivity, usability, and visual representation of system processes. htop quickly gained popularity due to its user-friendly interface, intuitive navigation, and advanced features. Over time, it has become a widely used tool for system monitoring and process management across various Linux distributions.

SEE ALSO

top(1), ps(1), kill(1), renice(1)

Copied to clipboard