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.
| Shortcut | What it does |
|---|---|
-d DELAY / --delay=DELAY | Set 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-colour | Start in monochromeBoth spellings of the long option are accepted. |
-F FILTER / --filter=FILTER | Start with a command filterTerms are fixed strings matched without regard to case; put | between several terms. |
-p PID,PID / --pid=PID,PID | Show 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 COLUMN | Sort by a columnSwitches to the list view unless -t is given too; in tree mode it orders each process's direct children. |
--sort-key help | List 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=NUMBER | Exit after NUMBER updatesEach screen update counts as one iteration, so together with -d it limits the run time. |
--readonly | Start in read-only modeKeys that change a process, such as kill and the priority keys, do nothing in this mode. |
--no-meters | Hide the header metersPress # inside htop to show the meters again. |
--no-function-bar | Hide the function bar |
-M / --no-mouse | Disable the mouse |
-U / --no-unicode | Draw 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 / --help | Show help and exit |
-V / --version | Show 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.
| Shortcut | What it does |
|---|---|
| UporAlt+K | Select previous processMoves the highlight up one row and scrolls the list when it reaches the edge. |
| DownorAlt+J | Select next processMoves the highlight down one row, scrolling the list when needed. |
| LeftorAlt+H | Scroll list leftCtrl + A jumps all the way back to the start of the line. |
| RightorAlt+L | Scroll list rightCtrl + E jumps straight to the end of the line. |
| Page Up | Scroll up one windowJumps back by one screenful of processes. |
| Page Down | Scroll down one windowJumps forward by one screenful of processes. |
| Home | Go to first processScrolls back to the top and puts the highlight on that entry. |
| End | Go 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+Up | Pan view upTerminal emulators often take Shift + Up for scrollback; Alt + Up does the same job. |
| Shift+DownorAlt+Down | Pan 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. |
| F3 | Find next matchWorks in search mode and steps forward through the matches. |
| Shift+F3 | Find previous matchSteps through the matches in reverse while search mode is active. |
Numbers | Jump to a PIDType the digits of a process ID and the highlight moves to that process. |
| Shift+F | Follow 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.
| Shortcut | What it does |
|---|---|
| F6or<or> | Choose sort columnThe header highlights the column that currently sets the order. |
| Shift+I | Invert sort orderFlips between ascending and descending on the current sort column. |
| Shift+P | Sort by CPU usageOrders by processor usage, using the key that top uses. |
| Shift+M | Sort by memory usageOrders by memory usage; the key is the same one as in top. |
| Shift+T | Sort by timeOrders by the TIME column; another key carried over from top. |
| Shift+N | Sort by PID |
| F4or\ | Filter process listOnly processes whose command line contains the typed text stay visible; separate several terms with |
| F4thenEsc | Clear the filterReopen the filter prompt, then press Esc to show every process again. |
| U | Show one user's processesSame effect as starting with -u, but chosen while htop is running. |
Tree view and tagging 6
| Shortcut | What it does |
|---|---|
| F5orT | Toggle 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. |
| Space | Tag or untag processCommands such as kill then act on every tagged process rather than only the highlighted row. |
| C | Tag process and childrenMarks a whole process family at once, ready for a single signal. |
| Shift+U | Untag all processesClears every tag set with Space or C in one step. |
Signals and priority 8
| Shortcut | What it does |
|---|---|
| F9orK | Send 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. |
| A | Set CPU affinityOn multiprocessor machines, choose the CPUs the process may run on. |
| I | Set IO priorityShown on the F1 help screen but not in the man page; inactive in read-only mode. |
| Shift+Y | Set 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.
| Shortcut | What it does |
|---|---|
| S | Trace system callsAttaches strace to the highlighted process and shows its calls live; strace must be installed. |
| L | List open filesRuns lsof on the process to show its open file descriptors; lsof must be installed. |
| E | Show process environmentListed on the F1 help screen; the 3.5.2 man page does not mention this key. |
| W | Show wrapped command lineOpens a separate screen with the full command broken over as many lines as it needs. |
| X | Show file locksOpens a separate screen listing the locks the process currently holds. |
| B | Show backtraceWorks only when the feature was enabled when htop was compiled. |
Display toggles 8
| Shortcut | What it does |
|---|---|
| Shift+K | Hide kernel threadsA toggle: press again to bring the kernel's threads back into the list. |
| Shift+H | Hide user threadsToggles the threads of userspace processes on systems that list them separately. |
| Shift+O | Hide containerized processesToggles the processes that are running inside a container. |
| P | Show full program pathsToggles between the bare program name and its whole path, where the system provides it. |
| M | Toggle merged commandCombines the executable path, command name and command line in the Command column. |
| Shift+Z | Pause 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+L | Refresh the screenRedraws the display and recomputes every value without waiting for the next update. |
Screens, setup and help 5
| Shortcut | What it does |
|---|---|
| Tab | Next screen tabTab names appear only after you enable them in the Setup screen. |
| Shift+Tab | Previous screen tabCycles through the screen tabs in the opposite direction. |
| F2orShift+S | Open 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. |
| F10orQ | Quit htop |
No row on this page matches that filter.
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
- htop(1) manual page of htop 3.5.2 — htop.1.in at release tag 3.5.2 in the htop-dev/htop repository Command-line options and interactive commands
- htop 3.5.2 source — Action.c, the text of the built-in help screen (F1) and the default key table Keys the help screen lists but the man page omits: E, I, Shift + Y and #
- htop 3.5.2 source — CommandLine.c, the text printed by htop --help Options -n / --max-iterations and -H / --highlight-changes[=DELAY]
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.