How to Bulk Select Processes in htop?

The htop interactive process viewer is a powerful tool for monitoring system resources in Linux, but it also allows you to manage multiple processes simultaneously. While many users know how to kill a single process using the F9 key, managing large groups of processes requires bulk selection. By using the Spacebar to tag individual processes or specific shortcut keys to tag entire process trees, you can select multiple entries at once. Once tagged, any action you perform—such as killing processes, changing their nice values, or pinning them to specific CPU cores—will apply to the entire selection simultaneously.

Step-by-Step Guide to Bulk Selection

To perform bulk actions in htop, you must first “tag” the target processes. Tagged processes will change color (usually turning yellow or bold, depending on your terminal color scheme) to indicate they are selected.

  1. Navigate to the Target Process: Use the Up and Down Arrow keys to scroll through the process list and highlight the first process you want to select.
  2. Tag the Process: Press the Spacebar. You will notice the process highlights in a different color, and the cursor automatically moves down to the next line.
  3. Select Additional Processes: Continue moving up or down and pressing the Spacebar on every process you want to include in your bulk action.
  4. Untag a Process: If you accidentally select the wrong process, simply highlight it again and press the Spacebar to deselect it.

Bulk Selecting Entire Process Trees

If you need to select a parent process and all of its child processes (for example, multiple workers of a web server or browser tabs), tagging them individually can be tedious. You can select them all at once using the tree view shortcut.

Clearing All Selection Tags

If you have selected dozens of processes across your system and want to clear all tags instantly without scrolling through the list, use the global untag shortcut:

Executing Bulk Actions on Tagged Processes

Once you have successfully selected your group of processes, you can execute a command that applies to all of them at the same time. The most common bulk actions include: