Still using top to check processes? htop gives you a faster, clearer, and more powerful way to monitor your system. The htop command in Linux provides an interactive method of viewing current system processes. This tool gives you a snapshot of what your system is currently doing, including the processes that are active, how much CPU time each process is using, how much memory (RAM) each process has consumed, and how busy your processor cores are. All this information is displayed in a single window in a color-coded, scrollable interface. In addition to monitoring processes, htop allows you to interact with them using simple keyboard shortcuts, such as searching for specific processes, sorting data columns, killing unresponsive tasks, and adjusting process priorities all within the same terminal session.
Whether you are just starting to learn Linux and want to understand how your RAM is being utilized, or you are a system administrator troubleshooting a slow server, htop provides the insight and tools you need.
Note:
htop is a process monitor, not a process scheduler. If you need to list processes in a scriptable, non-interactive way, consider the
ps command.
For a built-in, command-line alternative to htop, see the
top command.
Examples
# Launch htop with default view
htop
# Monitor a specific user's processes
htop -u username
# Set a custom update delay (in tenths of a second)
htop -d 20
# Monitor a specific PID
htop -p 1234
htop Command in Linux: How to Launch htop
You can run htop by entering it directly into the terminal with no additional parameters. This launches an interactive, full-screen process monitoring dashboard. At the top, multiple panels display key system data, including per-CPU activity bars, memory and swap usage, load average (indicating how busy the system has been over recent intervals), uptime, and the total number of active tasks-providing a complete view of your system’s status. The display refreshes automatically, with a default update interval of every 2 seconds.
LinuxTeck.com
2 [||||| 18.3%] Load average: 0.45 0.38 0.31
Mem[||||||||||||| 2.34G/7.68G] Uptime: 03:14:22
Swp[ 0K/2.00G]
PID USER PRI NI VIRT RES SHR S CPU% MEM% TIME+ Command
1234 root 20 0 512M 18M 5.2M S 2.3 0.2 0:04.21 /usr/sbin/sshd
2871 john 20 0 1.2G 210M 42M S 1.1 2.7 0:31.08 /usr/bin/python3
891 www-data 20 0 412M 55M 12M S 0.5 0.7 0:12.44 nginx: worker
Note:
If htop is not installed, use the package manager for your distro:
sudo apt install htop (Ubuntu/Debian),
sudo dnf install htop (Fedora/RHEL),
sudo pacman -S htop (Arch).
Once inside htop, press q to quit and return to your shell.
htop Command in Linux: Sort by CPU or Memory Usage
When your computer is feeling slow, locate the largest resource-consuming application quickly. You can start htop with a sort in advance using the -s flag, or use the keyboard shortcuts P (for CPU) and M (for memory) after launching htop to view applications sorted accordingly.
LinuxTeck.com
htop -s PERCENT_CPU
# Launch htop pre-sorted by memory usage
htop -s PERCENT_MEM
3842 john 20 0 2.1G 512M 88M R 87.3 6.5 12:04.33 /usr/bin/python3 train.py
1204 root 20 0 980M 210M 44M S 12.1 2.7 3:21.07 /usr/bin/java -jar app.jar
512 john 20 0 612M 92M 18M S 3.4 1.2 0:44.12 /usr/bin/node server.js
Tip:
While inside htop, press F6 to open the sort column picker, or click directly on any column header to toggle between ascending and descending order. Press P to jump straight to CPU sort, and M for memory sort.
Search for a Running Process by Name
With so many applications running simultaneously, scrolling through them would be a waste of time. Simply click F3 (or /) to bring up a live search window that will highlight all applicable matches as you enter them.
LinuxTeck.com
htop
# Step 2 - press F3 or / then type the process name
# Example: searching for "nginx"
Search: nginx
891 www-data 20 0 412M 55M 12M S 0.5 0.7 0:12.44 nginx: master process
892 www-data 20 0 412M 48M 12M S 0.3 0.6 0:08.11 nginx: worker process
893 www-data 20 0 412M 47M 11M S 0.2 0.6 0:07.53 nginx: worker process
Note:
Press F3 again to jump to the next match if multiple processes share the same name. Press Esc to close the search bar and return to the full list. The search is case-insensitive by default.
Kill a Process Directly from htop
Once you have selected an application from the list, select it using the arrow keys and then press F9 to bring up the available options for sending signals to this application. Choose 15 for SIGTERM to allow for the graceful shutdown of the application; or choose 9 for SIGKILL to send a "force" terminate signal. There is no reason to first look up the PID of each process individually.
LinuxTeck.com
htop
# Step 2 - use arrow keys to select the process
# Step 3 - press F9, select signal, press Enter
# To force-kill: select signal 9 (SIGKILL)
2 SIGINT Interrupt (same as Ctrl+C)
3 SIGQUIT Quit and dump core
9 SIGKILL Kill immediately (cannot be caught)
15 SIGTERM Graceful termination (default)
[ Use arrow keys to select, Enter to confirm ]
Danger - SIGKILL:
Signal 9 (SIGKILL) terminates a process instantly with no cleanup. Unsaved data will be lost and open files may be left in an inconsistent state. Always try 15 (SIGTERM) first and only escalate to SIGKILL if the process does not respond.
Filter Processes by a Specific User
If you're working on multiple computers, it won't take long before the number of users creates a crowded list of processes. In addition to launching htop with the -u option to view only the processes of one user at a time, you may also use the u key within htop to browse through users and pick which ones' processes you want to display.
LinuxTeck.com
htop -u www-data
# Show only processes owned by the current logged-in user
htop -u $USER
891 www-data 20 0 412M 55M 12M S 0.5 0.7 0:12.44 nginx: master process
892 www-data 20 0 412M 48M 12M S 0.3 0.6 0:08.11 nginx: worker process
1021 www-data 20 0 380M 41M 10M S 0.2 0.5 0:05.33 php-fpm: pool www
Tip:
You can also filter by user interactively while inside htop - press u to open a user list and select the one you want. Press u again and choose All users to clear the filter.
View Processes in Tree Mode
Tree mode shows parent–child relationships between processes, making it easy to spot which workers were forked from which parent. Launch with -t or toggle with F5 while inside htop.
LinuxTeck.com
htop -t
# Toggle tree view while already inside htop
# Press F5
1 root 0.0 0.1 systemd
├─ 512 root 0.0 0.1 ├─ sshd
│ └─ 891 john 0.1 0.2 │ └─ sshd: john@pts/0
│ └─ 892 john 0.0 0.1 │ └─ bash
├─ 210 root 0.0 0.2 ├─ nginx: master process
│ ├─ 211 www-data 0.3 0.6 │ ├─ nginx: worker process
│ └─ 212 www-data 0.2 0.5 │ └─ nginx: worker process
Note:
In tree mode, killing a parent process will also terminate all its child processes. Press F5 again to switch back to the flat list view at any time.
Change Process Priority (Renice) in htop
Every process has a nice value from -20 (highest priority) to 19 (lowest). Inside htop, press F7 to raise priority or F8 to lower it - no need to exit and run renice manually.
LinuxTeck.com
htop
# Step 2 - select a process with arrow keys
# Step 3 - press F7 to increase priority (lower nice value)
# Step 4 - press F8 to decrease priority (raise nice value)
# Alternatively, renice from the terminal directly
renice -n 10 -p 3842
3842 john 30 10 2.1G 512M 88M R 14.2 6.5 12:09.01 /usr/bin/python3 train.py
3842: old priority 0, new priority 10
Tip:
Only the root user can set a negative nice value (higher priority than default). Regular users can only increase the nice value - making a process slower, not faster. Use sudo htop if you need to boost a process priority.
Essential htop Keyboard Shortcuts
htop is designed to be fully keyboard-driven. These are the shortcuts you will reach for most often. Press h inside htop to see the complete list.
LinuxTeck.com
Arrow keys # Move up/down through the process list
Space # Tag/untag a process for bulk actions
# Sorting
P # Sort by CPU usage
M # Sort by memory usage
T # Sort by total time
F6 # Open sort column picker
# Actions
F3 or / # Search for a process by name
F5 # Toggle tree view
F7 / F8 # Decrease / increase nice value
F9 # Kill selected process (signal menu)
u # Filter by user
h # Open help screen
q # Quit htop
Note:
You can also use the mouse inside htop - click any column header to sort, click a process to select it, and click the function key labels at the bottom bar to trigger actions. Disable mouse support with htop -M if you prefer keyboard-only mode.
htop vs top Command - Key Differences
Both tools monitor processes in real time, but they differ significantly in usability. top ships pre-installed everywhere; htop must be installed separately. Here is a direct feature comparison.
LinuxTeck.com
top
# Launch the modern htop
htop
Tip:
Use top when working on a minimal or fresh server where htop is not yet installed. Once you have package manager access, install htop - you will rarely go back to top for interactive monitoring.
Run htop as Root for Full System View
Running htop as a regular user hides some system-level processes. Use sudo htop to see everything - including kernel threads - and to renice or kill processes owned by root or other system users.
LinuxTeck.com
sudo htop
# Combine with user filter to watch a system user as root
sudo htop -u mysql
1 root 20 0 168M 11M 8.2M S 0.0 0.1 0:03.44 /sbin/init
2 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 [kthreadd]
3 root -51 0 0 0 0 S 0.0 0.0 0:00.00 [rcu_gp]
512 mysql 20 0 1.8G 420M 32M S 1.2 5.4 2:14.07 /usr/sbin/mysqld
Danger - Root Kills:
Running sudo htop lets you kill any process on the system, including critical kernel threads and system daemons. Terminating the wrong process can crash services or destabilize the server.
Always double-check the process name and PID before sending a signal when operating as root.
Conclusion
The htop command in Linux is one of the most efficient tools for monitoring system performance. Whether you're trying to debug a slow server, monitor a long running script, or simply learn about how Linux manages its own processes; htop provides an immediate and actionable way to view your system’s performance. It's one tool that offers all the functionality of top but with a clean and fast interface.
Once installed, htop will be your new "go to" for system monitoring. htop in Linux has been described as being among the best ways to use your terminal in terms of utility. In addition to viewing CPU and memory usage in real-time, htop allows you to kill a rogue process, filter by user, renice jobs, and see what makes up a process tree.
People Also Ask
What is htop used for in Linux?
htop is an interactive, real-time process viewer for Linux. It shows running processes, CPU usage, memory consumption, and allows filtering and process control. Refer htop man page.
Is htop better than top?
Yes. htop provides a better UI, mouse support, scrolling, and easier process management compared to top.
How do I install htop on Linux?
Use your package manager: sudo apt install htop, sudo dnf install htop, or sudo pacman -S htop.
How do I quit htop?
Press q, F10, or Ctrl+C to exit.
How do I kill a process in htop?
Select a process and press F9, then choose a signal like SIGTERM or SIGKILL.
Does htop work on all Linux distributions?
Yes, it is available on all major Linux distributions and even on macOS via Homebrew.
From your first terminal command to advanced sysadmin skills - every guide here is written in plain English with real examples you can run right now.