Which Function Key Exits the htop Command in Linux?
The htop command-line utility is a popular interactive
process viewer and system monitor for Linux distributions. While it
provides a comprehensive, real-time overview of your system’s
resources—such as CPU usage, memory consumption, and running tasks—users
frequently need to know how to properly close the application. This
article identifies the specific function key used to terminate
htop and return to the standard terminal shell, while also
covering alternative keyboard shortcuts that achieve the exact same
result.
The Standard Key to Exit htop
The primary and standard function key used to terminate
htop and safely exit back to the Linux shell is
F10.
When you press F10, the utility immediately stops
monitoring system resources, releases the terminal screen real estate it
was utilizing, and restores your prompt. This function key is
universally mapped across almost all Linux terminal emulators running
htop.
Alternative Ways to Exit htop
In some environments, function keys like F10 are intercepted by the host operating system or the terminal emulator itself (for example, opening a top-level window menu). If pressing F10 does not close the utility, you can use these highly reliable alternative shortcuts:
- The ‘q’ Key: Pressing the lowercase q key on your keyboard is the quickest and most common alternative. It stands for “quit” and works instantly without needing a function modifier.
- Ctrl + C: The standard interrupt signal (Ctrl + C) can also be used to forcefully terminate the process and return control to your shell.
Using either F10 or q is generally
preferred, as they allow htop to perform a clean internal
shutdown sequence before handing control back to the terminal.