What Is the Htop Follow Process Feature?
The htop utility is an interactive system monitor for
Linux that provides a real-time, color-coded view of system resources
and running processes. While navigating a busy system, processes
constantly shift positions on the screen as their CPU or memory usage
changes, making manual tracking difficult. The “Follow Process” feature
solves this problem by locking the interface’s focus onto a single
chosen process, automatically scrolling and moving the selection bar to
track that specific item regardless of how its resource consumption
fluctuates.
Why the Process List Constantly Shifts
By default, htop sorts processes based on their CPU
usage. Because resource consumption is highly dynamic, a process using
15% CPU might be at the top of the list one second, and drop down
several rows the next second when another process spikes.
If you are trying to monitor a specific application, this constant
shuffling can cause you to lose sight of it, or worse, accidentally send
a termination signal (like SIGKILL) to the wrong process
because the list jumped just as you pressed the key.
How the “Follow Process” Feature Solves This
When you trigger the Follow Process feature, you tell
htop to anchor your selection highlight to that specific
Process ID (PID).
- Automatic Tracking: As the process moves up and down the list based on the active sorting criteria, the highlight bar moves with it.
- Smart Scrolling: If the process moves entirely off
the visible screen because its resource usage dropped,
htopwill automatically scroll the window up or down to keep that process in plain view. - Safer Management: Keeping the process safely highlighted ensures that any subsequent actions you take—such as changing its priority (renicing) or killing it—are executed on the correct target.
How to Use Follow Process in htop
Using this feature requires only a couple of keystrokes while
htop is running in your terminal:
- Use the Up and Down arrow keys to navigate the list and highlight the process you want to track.
- Press the
Fkey (uppercaseF, orShift + f). - A visual indicator (usually a change in the selection bar or an
explicit tag depending on your configuration) will confirm that
htopis now following that specific PID. - To stop tracking the process and return to normal scrolling, simply
press
Fagain or move your cursor manually to a different process.