How to Invert Sorting Order in htop?

The htop command-line utility is a powerful, interactive process manager for Linux that allows users to monitor system resources and manage running processes in real time. While the tool automatically sorts processes by CPU usage by default, users often need to reverse this order to find the least resource-intensive tasks or reorganize filtered data. Inverting the current sorting order in htop can be achieved instantly using a single keyboard shortcut, Shift + I, which toggles the list between ascending and descending order based on the currently selected column.

Inverting the Sort Order with Shift + I

When navigating the htop interface, you can change the active sorting column by using the mouse or by pressing F6 to select a specific metric, such as MEM%, VIRT, or PID. Once your desired column is active, pressing the I key while holding down Shift (Shift + I) will immediately flip the sorting direction.

This shortcut acts as a quick toggle, meaning you can press it again at any time to return to the original sorting view.

Alternative Navigation for Sorting

If you prefer using the built-in menu system over keyboard shortcuts, you can also manage the sorting direction through the interactive setup screen:

  1. Press F2 (or Shift + S) to open the htop setup menu.
  2. Use the arrow keys to navigate to the Setup column and select Meters or Display options.
  3. Move to the Available columns or active sorting setup where direction can be manually toggled.
  4. Press F10 to save your changes and return to the main process list.

Using the Shift + I shortcut remains the fastest and most efficient method to analyze process data without leaving the main dashboard view.