How to Filter htop by User in Linux?

The htop command-line utility is a powerful, interactive process viewer for Linux that provides a real-time, color-coded overview of system resources and running processes. While it displays all system processes by default, you can easily restrict the view to monitor only the processes owned by a specific user. This article covers how to filter the htop display both when launching the tool from the terminal and while interacting with it directly inside the interface.

Filtering by User on Launch

The quickest way to isolate a specific user’s activity is to apply a filter flag directly when executing the command in your terminal. This prevents htop from loading unnecessary system processes from the start.

To launch htop pre-filtered for a specific user, use the -u or --user flag followed by the username:

htop -u username

For example, if you only want to monitor processes started by the user john, you would run:

htop -u john

You can also use a user’s numerical User ID (UID) instead of their username:

htop -u 1001

Filtering by User Inside the htop Interface

If you already have htop running and want to filter the process list without closing the program, you can use the interactive menu.

  1. Press u on your keyboard to open the user filter menu.
  2. A sidebar will appear on the left side of the screen listing all users currently running processes, along with an option for All users.
  3. Use the Up and Down arrow keys to navigate through the list of usernames.
  4. Press Enter to select the desired user.

Once selected, the interface will instantly refresh to display only the processes belonging to that specific individual. To clear the filter and view all system processes again, press u and select All users from the top of the menu list.