Interactive Process Viewer (Enhanced Top)
The htop command is like top on steroids—it's an enhanced, colorful, interactive process viewer that makes monitoring your Linux system much easier and more intuitive.
Unlike the basic top command, htop features full-color visual bars for CPU and memory, mouse support for clicking and scrolling, tree view to see process hierarchies, easier process killing (no need to remember PIDs), horizontal and vertical scrolling, and function keys for common actions. It's the go-to tool for system administrators who want a better real-time monitoring experience. Think of it as the difference between Notepad and a modern code editor—same purpose, but htop is way more user-friendly and powerful.
Advertisement
[ Insert Google AdSense Banner Code Here ]
Use htop instead of top for everyday server health checks.
Tree view (F5) shows which processes spawned others.
Easily filter and view processes by different users with color coding.
Visual bars show CPU/memory at a glance—no math needed.
htop Start the interactive process viewer with full colors and mouse support.
htop -u username Show processes only for a specific user (replace "username" with: root, mysql, www-data, postgres, or user).
htop -p 789 Monitor specific process ID (PID 1234).
htop --sort-key PERCENT_CPU Start sorted by CPU usage (default behavior).
htop --sort-key PERCENT_MEM Start sorted by memory usage instead of CPU.
Installation Required: Unlike top, htop needs to be installed first. On Ubuntu/Debian: sudo apt install htop, CentOS/RHEL: sudo yum install htop, Arch: sudo pacman -S htop
Simulator Password: When testing installation commands in the simulator below, use password: admin123
Use Your Mouse: Unlike top, you can click on column headers to sort, click processes to select them, and scroll with your mouse wheel!
Tree View is Powerful: Press F5 to see which processes started others. Great for finding parent processes causing issues.
Search is Your Friend: Press F3 or / to search for processes by name instead of scrolling.
Create an Alias: Add alias top='htop' to your .bashrc so typing "top" runs htop instead!
Experience the colorful htop interface below. Notice the visual differences from top—colorful bars, function key shortcuts, and better layout: