Which Function Key Filters by Name in htop?
The htop command-line utility is a powerful, interactive
process manager for Linux that allows users to monitor system resources
and manage running processes in real time. When dealing with a crowded
process list, quickly isolating a specific application is essential for
efficient troubleshooting. This article identifies the exact function
key used to filter processes by name in htop, explains how
to use the filtering feature effectively, and highlights the key
differences between the “Filter” and “Search” functions within the
tool.
The Shortcut Key for Filtering in htop
To filter processes by name in htop, press the
F4 key.
When you press F4, a prompt labeled
“Filter:” will appear in the bottom status bar of your
terminal window. As you type the name of the process or command you are
looking for, htop dynamically updates the display in real
time, hiding all other active processes that do not match your search
criteria. This makes it incredibly easy to isolate resource-heavy
applications, like multiple instances of a web browser or a specific web
server daemon, without losing sight of their live CPU and memory
metrics.
How to Use the Filter Function
Using the filter tool involves a few straightforward steps:
- Open htop: Launch the utility by typing
htopin your terminal. - Activate the filter: Press F4.
- Type the process name: Enter the keyword or name of
the process (e.g.,
nginx,python, orchrome). The list will instantly shrink to show only matching entries. - Clear or exit the filter: To clear the active filter and return to the complete process list, press F4 again and backspace the text, or press Esc to cancel the filtering mode entirely.
htop Filter vs. Search: What is the Difference?
It is common to confuse the Filter function with the Search function, but they serve different purposes:
| Feature | Shortcut Key | Behavior | Best Used For |
|---|---|---|---|
| Filter | F4 | Hides all non-matching processes, showing only the rows that contain your text string. | Isolating a specific application and its child processes. |
| Search | F3 | Keeps the entire process list visible but highlights the first matching entry. Pressing F3 repeatedly jumps to the next match. | Locating a specific process within the context of the entire system load. |
By mastering the F4 filter shortcut, you can significantly speed up your system administration workflows, allowing you to locate, monitor, or terminate specific groups of Linux processes in seconds.