Commands.page Logo

How to Filter htop to Show Running Processes on Ubuntu

This guide explains how to configure the htop process viewer on Ubuntu to display only active running processes. By applying specific filters and sorting options, users can reduce clutter and focus on tasks currently consuming system resources. We will cover the interactive filter command and state-based sorting options to streamline system monitoring.

Install htop

If htop is not already installed on your Ubuntu system, open your terminal and run the following command:

sudo apt update
sudo apt install htop

Launch htop

Start the process viewer by typing the following command in your terminal:

htop

Sort Processes by State

htop does not have a direct button to hide sleeping processes, but you can sort the list to bring running processes to the top.

  1. Press F6 to open the sort menu.
  2. Use the arrow keys to select STATE.
  3. Press Enter to apply the sort.
  4. Look for processes with the state R (Running) at the top of the list.

Filter by Process Name

If you are looking for a specific running application, you can filter the list by name.

  1. Press F4 to open the filter bar.
  2. Type the name of the process (e.g., python or nginx).
  3. htop will immediately hide all processes that do not match the text.
  4. Press F4 again to clear the filter.

Hide Kernel Threads

To further reduce clutter and focus on user-level running processes, you can hide kernel threads.

  1. Press F2 to open the Setup menu.
  2. Navigate to the Display options section.
  3. Check the box for Hide kernel threads.
  4. Press F10 to save and exit the setup.

Exit htop

When you are finished monitoring, press F10 or q to close htop and return to the terminal prompt.