What Does the O Shortcut Do in htop?
The htop command-line utility is a powerful, interactive
process viewer for Linux that allows users to monitor system resources
and manage running processes in real time. Among its many keyboard
shortcuts, the O (uppercase) or o
(lowercase) key plays a critical role in organizing this data by opening
the Sort By menu. This article explains how to use this
shortcut to reorder your process list, compares it to other navigation
keys, and highlights how it improves system troubleshooting.
Managing Process Sorting with the O Key
When you are monitoring a system, the default process list can be
overwhelming. Pressing o or
F6 brings up a sidebar menu on the left
side of the screen displaying all available criteria for sorting your
processes.
Using this menu, you can quickly sort your running applications by:
- CPU%: To identify which process is consuming the most processor power.
- MEM%: To find memory leaks or resource-heavy applications.
- PID: To organize processes chronologically by their Process ID.
- USER: To group processes by the specific user running them.
To use it, simply press o, use the up and down arrow
keys to select your preferred sorting metric, and press
Enter to apply the change.
The Difference Between Lowercase ‘o’ and Uppercase ‘O’
While both keys are related to sorting, they serve slightly different
functions depending on the version of htop you are
running:
- **Lowercase
o**: Opens the interactive sorting menu dynamically on the left side of the window. - **Uppercase
O**: In older versions ofhtop, this instantly reverses the current sort order (e.g., switching from ascending to descending). In newer versions, it acts identically to the lowercase key, ensuring you always get to the sorting menu regardless of your Caps Lock status.
Why This Shortcut is Essential for Sysadmins
Using the o shortcut significantly speeds up
troubleshooting. Instead of manually searching through hundreds of rows
of data, a quick tap of the o key allows an administrator
to instantly isolate the exact process responsible for a system slowdown
or a memory spike, making it one of the most vital navigation tools in
the htop environment.