How to Enter the Setup Menu in htop?
The htop command-line tool is a popular, interactive
process viewer for Linux that allows users to monitor system resources
in real time. To customize its display, configure meters, and change
color schemes, you need to access its built-in setup menu. This article
provides a quick guide on how to open the setup interface using keyboard
shortcuts, navigate its various configuration sections, and save your
changes to optimize your system monitoring experience.
Opening the Setup Menu
To enter the setup menu in htop, you must first have the
utility running in your terminal. Once htop is active and
displaying your system’s processes, you can access the configuration
screen using either of the following methods:
- Press the F2 key: This is the standard function key shortcut to immediately open the setup menu.
- Press the Shift + S keys (Capital ‘S’): If your terminal captures function keys or you are using a keyboard without a dedicated F2 key, pressing capital S acts as an alternative shortcut to enter the setup screen.
Navigating the Setup Interface
Once inside the setup menu, the screen splits into two main sections: Setup options on the left and the corresponding Makers/Content options on the right. You can navigate through these settings using standard keyboard controls:
- Arrow Keys: Use the Up and Down arrow keys to move through the menu items. Use the Left and Right arrow keys to switch between the left setup column and the right configuration column.
- Spacebar or Enter: Use these keys to select or toggle specific options, such as adding or removing meters from your dashboard.
- F5 or F6: When configuring the top meters, these keys allow you to move selected items up or down in the display hierarchy.
Available Configuration Sections
The setup menu is organized into four primary categories that allow
you to customize how htop behaves and looks:
- Meters: Customize the top portion of the
htopinterface. You can add, remove, or rearrange visual bars and text readouts for CPU usage, memory, swap space, hostname, and clock. - Display Options: Toggle specific visual preferences, such as showing or hiding kernel threads, displaying hostnames, and updating the refresh interval.
- Colors: Choose from several pre-designed color themes (such as Default, Light Terminal, Black on White, or Midnight) to improve readability based on your terminal background.
- Columns: Select which process metrics are visible in the main table. You can add columns like Process ID (PID), User, Processor ID, Memory consumption, or CPU percentage, and arrange their order from left to right.
Saving Changes and Exiting
After customizing your htop interface, you can save your
preferences and return to the main process monitoring view by pressing
the F10 key or the Esc key.
htop automatically writes these settings to a configuration
file in your home directory (typically located at
~/.config/htop/htophrc), ensuring that your personalized
layout remains intact the next time you launch the tool.