How do you use the Linux htop command?

This article provides a comprehensive guide to understanding and using htop, an interactive system-monitor process-viewer for Linux systems. We will explore what makes this tool essential for system administrators, how to install it across different distributions, the layout of its colorful interface, and the basic keyboard shortcuts needed to effectively manage system resources.

Understanding the htop Utility

The htop command is a popular alternative to the classic top utility. It provides a dynamic, real-time view of a running system, displaying vital metrics such as CPU usage, memory consumption, swap usage, and a detailed list of active processes. Unlike its predecessor, htop features a colorful, visually intuitive interface that supports mouse interaction and allows users to scroll vertically and horizontally to view all running processes alongside their full command lines. For a deeper dive and additional documentation, you can explore this htop resource to expand your knowledge.

Installing the Software

Because it is so widely used, htop is available in the default repositories of almost all major Linux distributions. You can install it using your system’s package manager. For Debian or Ubuntu-based systems, use sudo apt install htop. On Fedora or RHEL-based systems, the command is sudo dnf install htop. Arch Linux users can install it via sudo pacman -S htop. Once the installation is complete, simply type htop in your terminal and press Enter to launch the program.

When you open htop, the screen is divided into three main sections:

Essential Keyboard Shortcuts

Navigating the environment is straightforward once you know a few fundamental shortcuts: