Skip to main content

htop: A Better Process Management Tool for Linux

·439 words·3 mins
Htop Linux Process Management System Monitoring
Table of Contents

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:

  1. Real-time monitoring of processes and resource usage.
  2. Display of processes in a tree structure.
  3. Support for both keyboard shortcuts and mouse interactions.
  4. Sorting by CPU, memory usage, or other criteria.
  5. Color-coded process information for quick identification.
  6. Detailed metrics: CPU %, memory, and virtual memory usage per process.
  7. Display of command-line arguments for each process.
  8. System-level stats such as CPU usage, total memory, free memory, and swap.
  9. Rich set of keyboard shortcuts for filtering, killing processes, and adjusting priorities.
  10. 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.

Related

Using the envsubst Command to Replace Environment Variables
·393 words·2 mins
Envsubst Linux Shell Script Environment Variables
Systemctl 命令详解及使用教程
·1669 words·8 mins
Linux Linux Systemctl Systemd
CentOS和Ubuntu,哪个更适合你的Linux服务器
·116 words·1 min
Linux CentOS Data Center Linux Server Ubuntu