How to View Process Trees in htop?

The htop command-line utility provides an interactive, real-time monitoring system for Linux processes, offering a cleaner interface than the traditional top command. One of its most powerful features is the ability to display processes in a tree view hierarchy, which visually groups child processes under their parent processes. This hierarchical view makes it significantly easier to trace the origin of a process, understand application dependencies, and identify which master process spawned a series of resource-heavy sub-tasks. Navigating this view can be done instantly through a simple keyboard shortcut or by adjusting the permanent display settings within the tool.

Enabling Tree View Instantly

When you have htop running in your terminal, the fastest way to switch from the standard flat list to a hierarchical tree view is by using a single keyboard shortcut.

Once activated, you will see visual lines connecting parent processes to their children, and the process names will be indented to reflect their depth in the system architecture.

Configuring Tree View as the Default

If you prefer htop to always launch in tree view without needing to press a shortcut every time, you can save this preference in the configuration menu.

  1. Launch htop in your terminal.
  2. Press F2 (or S) to enter the Setup menu.
  3. Use the arrow keys to navigate to the Display options column.
  4. Move down the list and highlight the option labeled Tree view.
  5. Press the Spacebar to check the box and enable it.
  6. Press F10 (or Esc) to save your changes and return to the main monitoring screen.

Once the tree view is active, htop provides additional functionality to manage how the hierarchy is displayed and interacted with: