Introduction
In the world of Linux system management, having tools that provide a clear and real-time view of resource use is essential to diagnose problems and optimize performance. Although the top command has for years been the de facto standard for monitoring processes, its static interface and limited interactivity may be insufficient for users seeking a more friendly and visual experience. Here htop comes into play, a modern alternative that combines top power with a ncurses, colors and keyboard-based interface. This post explores what htop is, how it is installed, how your screen is interpreted and what advanced functions it offers to make the most of it in production and development environments.
What's htop?
htop is an interactive process monitor written in C that uses the ncurses library to draw a screen divided into several areas. The top shows a summary of the use of CPU, memory and swap, accompanied by coloured progress bars that facilitate the immediate identification of bottle necks. In the center each process is listed with your PID, user, priority, memory consumption and CPU percentage, ordered by default by the use of CPU. Unlike top, htop allows you to move vertically and horizontally through the keyboard arrows, search processes with the F3 key and remove or renegotiate priorities with F9 and F7 respectively. In addition, its modular design allows you to add custom columns, change the color scheme and save settings for future sessions.
Installation
Htop installation varies according to distribution, but in most cases it is available in official repositories.
- In Debian-based distributions such as Ubuntu or Linux Mint, just run sudo apt update followed by sudo apt install htop.
- In Red Hat-based systems such as CentOS, Fedora or Rocky Linux, dnf install htop or yum install htop is used according to the version.
- In Arch Linux and its derivatives, the command is sudo pacman -S htop.
- For users who prefer to compile from the source code, the official repository in GitHub provides the code and instructions to compile with make and make install.
After installation, just type htop in any terminal to launch the interface.
Interface and navigation
When you start htop, the screen is divided into three main sections. The top bar shows the use of each CPU core as color bars, followed by RAM and swap, with numerical values and percentages. Right below, the process list occupies most of the screen; each row represents a process and can be ordered by clicking on the column header or by pressing F6 to select the management criterion. The navigation is done with the arrows up and down to move between processes, and left and right to move horizontally when the list exceeds the width of the terminal. The function keys offer shortcuts:
- F1 opens the aid.
- F2 allows to configure display options.
- F3 seeks a process by name.
- F4 incremental filter.
- F5 shows the view of process tree.
- F6 chooses the management criterion.
- F7 and F8 reduce or increase the nice value.
- F9 sends a signal to finish or send other signals to the selected process.
Advanced functions
Beyond basic visualization, htop includes several functions that make it a powerful diagnostic tool.
- The tree view (activated with F5) shows the father-child relationship between processes, facilitating the identification of spawned processes by a specific service.
- The incremental filter (F4) allows you to write part of the name of a process and see only those that match, which is useful when looking for a specific service between hundreds of entries.
- It is possible to mark several processes with the space bar and apply a signal to all of them simultaneously with F9, which groups tasks like finishing all of a user's processes.
- htop supports the customization of columns using the configuration menu (F2), where information such as the E / S index, the start time or the running environment can be added.
- The configuration is saved in the file ~/ .config / htop / htoprc, allowing each user to have its own color scheme and column distribution.
Conclusion
htop has been consolidated as one of the most appreciated tools by system administrators, developers and Linux enthusiasts thanks to its combination of detailed information, interactivity and customization. Your learning is fast: just know the most used function keys to move from simple observation to active control over system processes. If you have not yet tried it, install htop and spend a few minutes exploring its interface will change the way you monitor and manage the resources of your Linux machine.


