htop commands

Keys and startup options of htop 3.5.2, taken from the project's own man page, with the built-in help screen and --help text filling the gaps. One keymap applies on every system htop runs on. Letter keys are case-sensitive: the manual's lowercase s is shown here as S and its capital S as Shift + S. Every function key also has a letter or symbol alias. Mouse actions, setup-screen keys and pcp-htop options are not listed.

77 commands in 8 sections. Checked row by row against htop(1) manual page of htop 3.5.2 on . Edited by Jay.

Startup options 18

A value that a long option requires is required by its short form as well, so -d takes the same DELAY as --delay.

ShortcutWhat it does
-d DELAY / --delay=DELAYSet the update delayDELAY counts tenths of a second and is clamped to the range 1 to 100, so 0.1 to 10 seconds.
-C / --no-color / --no-colourStart in monochromeBoth spellings of the long option are accepted.
-F FILTER / --filter=FILTERStart with a command filterTerms are fixed strings matched without regard to case; put | between several terms.
-p PID,PID / --pid=PID,PIDShow only listed PIDsSeparate several process IDs with commas and no spaces.
-u / --user[=USERNAME|UID]Show one user's processesTakes a user name or a numeric UID; with no value it lists your own processes.
-s COLUMN / --sort-key COLUMNSort by a columnSwitches to the list view unless -t is given too; in tree mode it orders each process's direct children.
--sort-key helpList sortable columnsPrints the column names that -s and --sort-key accept.
-t / --tree[=MODE]Start in tree viewMODE selects the stable tree mode: 0 or classic, 1 or soft, 2 or hard.
-H / --highlight-changes[=DELAY]Highlight new and exited processesThe DELAY value is optional and is read as a number of seconds.
-n NUMBER / --max-iterations=NUMBERExit after NUMBER updatesEach screen update counts as one iteration, so together with -d it limits the run time.
--readonlyStart in read-only modeKeys that change a process, such as kill and the priority keys, do nothing in this mode.
--no-metersHide the header metersPress # inside htop to show the meters again.
--no-function-barHide the function bar
-M / --no-mouseDisable the mouse
-U / --no-unicodeDraw meters in ASCIIAffects the graph meters, which otherwise use Unicode characters.
--drop-capabilities[=off|basic|strict]Drop Linux capabilitiesLinux builds with libcap only; strict mode also disables killing and priority changes.
-h / --helpShow help and exit
-V / --versionShow version and exit

Moving and searching 17

Typing a command name also starts a search without F3, but a first character that is itself a key runs that key instead.

ShortcutWhat it does
UporAlt+KSelect previous processMoves the highlight up one row and scrolls the list when it reaches the edge.
DownorAlt+JSelect next processMoves the highlight down one row, scrolling the list when needed.
LeftorAlt+HScroll list leftCtrl + A jumps all the way back to the start of the line.
RightorAlt+LScroll list rightCtrl + E jumps straight to the end of the line.
Page UpScroll up one windowJumps back by one screenful of processes.
Page DownScroll down one windowJumps forward by one screenful of processes.
HomeGo to first processScrolls back to the top and puts the highlight on that entry.
EndGo to last processScrolls down to the bottom and puts the highlight on that entry.
Ctrl+Aor^Scroll to start of lineReturns the view to the left edge after scrolling sideways through a long entry.
Ctrl+Eor$Scroll to end of lineBrings the right-hand end of the process entry into view.
Shift+UporAlt+UpPan view upTerminal emulators often take Shift + Up for scrollback; Alt + Up does the same job.
Shift+DownorAlt+DownPan view downAlso the way to pan the view while follow mode keeps the highlight on one process.
F3or/Search process listIncremental: the highlight jumps to the first matching command line as you type.
F3Find next matchWorks in search mode and steps forward through the matches.
Shift+F3Find previous matchSteps through the matches in reverse while search mode is active.
NumbersJump to a PIDType the digits of a process ID and the highlight moves to that process.
Shift+FFollow a processKeeps the highlight on the same process as the list re-sorts; press again to stop.

Sorting and filtering 9

htop keys are case-sensitive. The manual prints a lowercase letter for the plain key and a capital for the shifted one; this page shows the plain key as a capital letter and the shifted one as Shift plus the letter, the way the manual itself writes the follow key.

ShortcutWhat it does
F6or<or>Choose sort columnThe header highlights the column that currently sets the order.
Shift+IInvert sort orderFlips between ascending and descending on the current sort column.
Shift+PSort by CPU usageOrders by processor usage, using the key that top uses.
Shift+MSort by memory usageOrders by memory usage; the key is the same one as in top.
Shift+TSort by timeOrders by the TIME column; another key carried over from top.
Shift+NSort by PID
F4or\Filter process listOnly processes whose command line contains the typed text stay visible; separate several terms with
F4thenEscClear the filterReopen the filter prompt, then press Esc to show every process again.
UShow one user's processesSame effect as starting with -u, but chosen while htop is running.

Tree view and tagging 6

ShortcutWhat it does
F5orTToggle tree viewLays processes out under their parents; press again to return to the previous sort view.
+or-Expand or collapse subtreeTree view only; a collapsed branch is marked with a plus sign beside the process name.
*Expand or collapse all subtreesActs on every child of the parentless PIDs, typically PID 1 and, on Linux, PID 2.
SpaceTag or untag processCommands such as kill then act on every tagged process rather than only the highlighted row.
CTag process and childrenMarks a whole process family at once, ready for a single signal.
Shift+UUntag all processesClears every tag set with Space or C in one step.

Signals and priority 8

ShortcutWhat it does
F9orKSend a signal (kill)Pick the signal from a menu; it goes to all tagged processes, or to the highlighted one if none is tagged.
F7or]Raise process prioritySubtracts from the nice value, which only the superuser is allowed to do.
F8or[Lower process priorityAdds to the nice value of the highlighted process.
Shift+F7or}Raise autogroup prioritySubtracts from the autogroup nice value; reserved for the superuser.
Shift+F8or{Lower autogroup priorityAdds to the nice value of the process's autogroup.
ASet CPU affinityOn multiprocessor machines, choose the CPUs the process may run on.
ISet IO priorityShown on the F1 help screen but not in the man page; inactive in read-only mode.
Shift+YSet scheduling policyAppears on the F1 help screen only in builds with scheduler support.

Inspecting a process 6

E, I, Shift + Y and # are taken from the help screen built into htop 3.5.2; its man page has no entry for them.

ShortcutWhat it does
STrace system callsAttaches strace to the highlighted process and shows its calls live; strace must be installed.
LList open filesRuns lsof on the process to show its open file descriptors; lsof must be installed.
EShow process environmentListed on the F1 help screen; the 3.5.2 man page does not mention this key.
WShow wrapped command lineOpens a separate screen with the full command broken over as many lines as it needs.
XShow file locksOpens a separate screen listing the locks the process currently holds.
BShow backtraceWorks only when the feature was enabled when htop was compiled.

Display toggles 8

ShortcutWhat it does
Shift+KHide kernel threadsA toggle: press again to bring the kernel's threads back into the list.
Shift+HHide user threadsToggles the threads of userspace processes on systems that list them separately.
Shift+OHide containerized processesToggles the processes that are running inside a container.
PShow full program pathsToggles between the bare program name and its whole path, where the system provides it.
MToggle merged commandCombines the executable path, command name and command line in the Command column.
Shift+ZPause or resume updatesFreezes the process list until the key is pressed again.
#Hide or show header metersListed on the F1 help screen; --no-meters starts htop with the meters hidden.
Ctrl+LRefresh the screenRedraws the display and recomputes every value without waiting for the next update.

Screens, setup and help 5

ShortcutWhat it does
TabNext screen tabTab names appear only after you enable them in the Setup screen.
Shift+TabPrevious screen tabCycles through the screen tabs in the opposite direction.
F2orShift+SOpen setup screenConfigure the header meters, display options, colour scheme and the columns and their order.
F1orHor?Open help screenLists the keys the installed build supports, including ones the man page omits.
F10orQQuit htop

Notes

Finding the process

F3 (or /) searches command lines incrementally and moves the highlight to the first match; F4 (or \) filters so only matching processes stay on screen, which is the one to use when a service has dozens of workers. F6 (or < / >) picks the sort column, and F5 (or T) switches to tree view so children sit under their parent.

Acting on it

Space tags a process, and after tagging several, F9 (or K) sends the signal you pick from its menu to all of them at once. F7 and F8 nice a process down or up (only root can raise priority). S attaches strace, L lists open files with lsof and E shows the environment. F10 or Q quits; the help screen on F1 or H lists everything the installed build supports.

Starting it the way you want

-t starts in tree view, -u shows one user (your own processes when no name follows), and --pid=PID,PID watches specific PIDs. --delay=DELAY sets the refresh in tenths of a second. On a server that should not be touched, --readonly disables every kill, nice and signal feature. --filter=FILTER starts with a filter already applied. Layout and colours are set once with F2 and saved to ~/.config/htop/htoprc.

Questions

How do I kill a process in htop?

Highlight it (or tag several with Space), press F9 or K and choose the signal from the menu. When processes are tagged, the signal goes to all of them.

Why do the function keys not work in my terminal?

Some terminals and multiplexers intercept them. Every F-key has an alias: / for search, \ for filter, T for tree, K for kill, H for help and Q to quit.

How do I show only one user's processes?

Start htop with --user[=USERNAME|UID], or with -u alone for your own processes, or press U while it is running.

How do I make htop safe to hand to someone?

Start it with --readonly. Kill, nice and signal features are disabled for that session.

Is S the same key as s in htop?

No. htop keys are case-sensitive. The manual's lowercase s (strace) is the plain S key on this page, and its capital S (setup) is Shift + S.

Sources and checks

Every row on this page was matched to a line in the documentation above on . A binding that could not be found there is not listed.

1 row from the earlier version of this page was removed in that check: duplicates, and bindings the documentation does not list or lists differently.

Found a wrong or missing key? Tell us and it gets checked against the source. How we verify describes the process and its limits.