Home·Terminal commands

htop

Processes and system

Usage

htop

A colourful, mouse-aware rewrite of top where F9 sends a signal directly, but it is not installed by default, so `apt install htop` or `brew install htop` comes first.

Common flags

FlagMeaning
-u <user>Start filtered to one user's processes.
-p <pid>[,<pid>]Show only these PIDs.
-tStart in tree view, children under their parent.
-d 10Refresh delay in tenths of a second, so 10 means one second.
F4 / F5 / F6 / F9Keys inside htop: filter, tree, sort column, send a signal.

Examples

htop -u www-data

Watch only the web server processes.

htop -t

Open in tree view to see which process spawned which.

What is running and what is eating the machine. Identifying it comes before killing it.

How to read this

  • Square brackets [ ] mark a part you may leave out.
  • An ellipsis … means you can list more than one.
  • Flags are case-sensitive — in some commands -r and -R do different things.

Questions

Q. What does htop do?

A colourful, mouse-aware rewrite of top where F9 sends a signal directly, but it is not installed by default, so `apt install htop` or `brew install htop` comes first.

Q. How do I type it?

htop — square brackets mark the parts you can leave out.

Q. How many flags are worth knowing?

5 are listed here; the full set is in man htop. This command sits under Processes and system.

Related commands

man page: man htop