Introduction #
If you’ve used Linux, you’re probably familiar with the top
command. It provides real-time insights into CPU usage and running processes. However, there’s an even better alternative: htop (short for High Top).
Compared to top
, htop offers a more user-friendly interface, advanced features, and easier navigation for managing processes and monitoring system resources.
Key Features of htop #
htop is more than just a prettier top
. It provides powerful functionality, including:
- Real-time monitoring of processes and resource usage.
- Display of processes in a tree structure.
- Support for both keyboard shortcuts and mouse interactions.
- Sorting by CPU, memory usage, or other criteria.
- Color-coded process information for quick identification.
- Detailed metrics: CPU %, memory, and virtual memory usage per process.
- Display of command-line arguments for each process.
- System-level stats such as CPU usage, total memory, free memory, and swap.
- Rich set of keyboard shortcuts for filtering, killing processes, and adjusting priorities.
- Customizable configuration for display, sorting, colors, filtering, and logging.
Installing htop #
htop is available in most Linux distributions. You can install it via your package manager.
Debian/Ubuntu #
sudo apt-get update
sudo apt-get install htop
Red Hat/CentOS #
sudo yum install epel-release
sudo yum install htop
Once installed, simply type htop
to launch it.
Using htop #
When you start htop, you’ll see its intuitive interface divided into three main sections:
Top Section #
Displays overall system information:
- Current time
- Uptime
- Load average
- CPU usage
- Memory and swap usage
Process List #
Shows running processes with details such as PID, user, CPU %, memory %, and command. Processes can be navigated with arrow keys or mouse clicks.
Bottom Section #
Summarizes system resource usage, including total/used/free memory, CPU load averages, and swap space usage.
htop Shortcuts #
htop provides handy keyboard shortcuts to make process management easier:
F1 — Help
F2 — Setup
F3/F4 — Search or filter processes
F5 — Refresh display
F6 — Change sort order
F7/F8 — Adjust process priority (nice value)
F9 — Kill process
F10 — Exit htop
Configuring htop #
Press F2 to enter the setup menu. Here you can customize htop to suit your workflow:
- Display options: Choose which columns to show.
- Sorting: Define how processes should be ordered.
- Colors: Customize the color scheme.
- Filtering: Limit display to specific users or processes.
- Logging: Enable recording of htop output to a file.
Conclusion #
htop
is more than just a replacement for top
—it’s a feature-rich process monitoring tool that makes managing Linux systems more efficient. Whether you’re debugging performance issues, analyzing system load, or just exploring processes, htop provides a clear, interactive, and customizable view of what’s happening inside your system.