htop is an interactive process viewer for Linux. It shows every running process with its CPU and memory use, updates the list live, and lets you scroll, search, filter, sort and kill processes with single keys or the mouse. Think of it as an easier, more colourful version of the top command.
To install and start it on Ubuntu or Debian:
sudo apt install htophtop
Press q or F10 to exit. The rest of this guide shows how to install htop on other systems, read its screen, use the most useful keys, and run it with command-line options. Everything was tested with htop 3.3.0 on Ubuntu 24.04. Ubuntu 26.04 ships htop 3.4.1, which uses the same keys and options.
htop vs top
Both tools show running processes, and top is installed everywhere. htop adds a few things that make daily work faster:
| Feature | htop | top |
|---|---|---|
| Scroll through the full process list | Yes, up/down and left/right | No, only the first screen |
| Mouse support | Yes | No |
| Kill or renice without typing a PID | Yes, select the process and press a key | No, you type the PID |
| Tree view of parent and child processes | Yes (F5) | Partly (V in newer versions) |
| Act on several processes at once | Yes, tag them with Space | No |
| Open strace and lsof for a process | Yes (s and l) | No |
| Installed by default | On some distros | Almost always |
Install htop
htop is in the default repositories of nearly every distribution. Use the command for your system:
| System | Command |
|---|---|
| Ubuntu, Debian, Linux Mint | sudo apt install htop |
| Fedora | sudo dnf install htop |
| Rocky Linux, AlmaLinux | sudo dnf install epel-release, then sudo dnf install htop |
| RHEL | Enable the EPEL repository, then sudo dnf install htop |
| Arch Linux, Manjaro | sudo pacman -S htop |
| openSUSE, SLES | sudo zypper install htop |
| Alpine Linux | sudo apk add htop |
| macOS (Homebrew) | brew install htop |
On RHEL and its rebuilds, htop isn’t in the base repositories, which is why you need EPEL first. There is no htop for Windows. On Windows 10 and 11 you can run it inside WSL (for example, an Ubuntu WSL install) with sudo apt install htop, but it shows only the processes inside WSL, not Windows programs.
Check the installed version:
htop --version
htop 3.3.0
Run htop
Open a terminal, type htop and press Enter:
htop
As a normal user you can see all processes but only change (kill or renice) your own. To manage any process, run it with sudo:
sudo htop

How to exit htop
Press q or F10. Ctrl+C also works. If the function keys don’t reach htop (some terminals and SSH apps use them for their own menus), use q.
Understanding the htop Screen
The htop screen has three parts: the meters at the top, the process list in the middle, and the function-key menu at the bottom.
The top meters
- CPU bars (1, 2, 3 …): one bar per CPU core. The colours show what the time was spent on: blue for low-priority (niced) processes, green for normal user processes, red for the kernel, and cyan for virtual machine (guest) time.
- Mem: RAM in use. Green is memory used by programs; blue (buffers) and yellow/orange (cache) is memory Linux borrows for disk caching and gives back when programs need it. The number on the right (for example
2.18G/7.77G) is used/total. A mostly yellow bar is normal and not a sign of low memory. - Swp: swap space in use. Swap that keeps growing means the system is short of RAM.
- Tasks: for example
100, 104 thr; 1 runningmeans 100 processes, 104 user threads, and 1 process using the CPU right now. - Load average: the average number of processes running or waiting over the last 1, 5 and 15 minutes. As a rough guide, a load higher than your number of CPU cores means processes are queuing.
- Uptime: how long the system has been running. htop adds
(!)after the days when the uptime passes 100 days, as a gentle reminder that the server may be missing kernel updates.
You can see the same memory numbers in plain text with the free command.
The process list columns
| Column | Meaning |
|---|---|
PID | Process ID |
USER | The user who owns the process |
PRI | Kernel priority of the process |
NI | Nice value, from -20 (highest priority) to 19 (lowest) |
VIRT | Virtual memory: everything the process has mapped, including memory it hasn’t used yet. Usually much bigger than RES and rarely useful on its own. |
RES | Resident memory: the RAM the process is actually using. This is the number to watch. |
SHR | Shared memory, such as libraries shared with other processes (part of RES) |
S | State: R running, S sleeping, I idle, D waiting on disk, Z zombie, T stopped or traced |
CPU% | Share of one CPU core used since the last update. A busy multi-threaded process can go above 100%. |
MEM% | RES as a percentage of total RAM |
TIME+ | Total CPU time the process has used, in minutes:seconds.hundredths |
Command | The command line that started the process |
Memory sizes without a letter are in KiB; M and G mean MiB and GiB. Highlighted values (like the red hours in the TIME+ column of the screenshot) just draw attention to large numbers.
Common Tasks in htop
Sort processes by CPU or memory
Press P (Shift+p) to sort by CPU, M to sort by memory and T to sort by CPU time. F6 opens a menu with every column you can sort by, and I inverts the order. You can also click a column header with the mouse.
Search and filter
F3or/searches: the cursor jumps to the next process whose command matches what you type. PressF3again for the next match.F4or\filters: only matching processes stay in the list. The match is case-insensitive, and you can give several names separated by|, for examplenginx|php-fpm. PressF4and thenEscto clear the filter.
Show one user’s processes
Press u, pick a user with the arrow keys and press Enter. Choose All users to go back.
Tree view
Press F5 or t to show which process started which. Use + and - to expand or collapse a branch. Press F5 again to return to the normal sorted list.
Kill a process
- Select the process with the arrow keys or the mouse (or type its PID to jump to it).
- Press
F9ork. - Pick a signal.
15 SIGTERMis selected by default and asks the program to close cleanly. Choose9 SIGKILLonly if the process ignores SIGTERM. - Press Enter.
To kill several processes at once, tag each one with Space (or press c to tag a process and all its children) and then press F9. Press U to untag everything. Outside htop, see how to kill a process by ID or by name.
Change a process’s priority
Select the process and press F8 (or [) to lower its priority, which raises its nice value, or F7 (or ]) to raise it. Any user can lower the priority of their own processes; raising priority needs root, so run sudo htop for that.
See open files and system calls
Select a process and press l to list its open files with lsof, or s to watch its system calls live with strace. Both tools must be installed, and tracing other users’ processes needs sudo.
Customise the display
Press F2 to open Setup. There you can add or remove meters (for example disk I/O, network I/O or temperature), add columns such as IO_RATE or STARTTIME, and choose a colour scheme. htop saves your choices to ~/.config/htop/htoprc when you quit, so they are kept the next time you start it. Delete that file to go back to the defaults.
htop Keyboard Shortcuts
The function keys are listed at the bottom of the screen. Press h or F1 inside htop to see every shortcut.
| Key | Action |
|---|---|
F1, h, ? | Help screen |
F2, S | Setup (meters, columns, colours) |
F3, / | Search by command name |
F4, \ | Filter by command name |
F5, t | Tree view on/off |
F6, <, > | Choose the sort column |
F7, ] | Higher priority (lower nice value, root only) |
F8, [ | Lower priority (higher nice value) |
F9, k | Kill: send a signal to the selected or tagged processes |
F10, q | Quit |
P / M / T / N | Sort by CPU% / MEM% / TIME / PID |
I | Invert the sort order |
u | Show one user’s processes |
Space | Tag or untag a process |
c | Tag a process and its children |
U | Untag all processes |
F | Follow the selected process as the list re-sorts |
H | Hide or show user threads |
K | Hide or show kernel threads |
p | Show or hide full program paths |
l | List open files (lsof) |
s | Trace system calls (strace) |
e | Show the process’s environment variables |
a | Set CPU affinity (which cores it may use) |
Z | Pause or resume screen updates |
| Numbers | Jump to a PID as you type it |

Keys are case-sensitive: u picks a user but U untags all processes, and k kills while K hides kernel threads.
htop Command-Line Options
You can set most of these from inside htop, but options are handy for scripts, aliases and quick checks.
| Option | What it does |
|---|---|
-u USER | Show only processes of USER |
-p PID,PID | Show only the given process IDs |
-F NAME | Start with a filter, like pressing F4 |
-s COLUMN | Sort by a column (htop -s help lists the names) |
-t | Start in tree view |
-d N | Update every N tenths of a second (default 15, so 1.5 s) |
-n N | Exit after N updates |
-H | Highlight new and exiting processes |
-C | No colours (monochrome) |
-M | Disable the mouse |
--readonly | Disable kill, renice and other changes |
Some examples:
htop -u www-data# only processes of the www-data user htop -p 1234,5678# watch two specific processes htop -s PERCENT_MEM# sort by memory on start htop -t -F nginx# tree view, only nginx processes htop -d 50# refresh every 5 seconds htop --readonly# safe view, nothing can be killed
To watch a single program by name, combine -p with pgrep:
htop -p $(pgrep -d, nginx)
pgrep -d, prints the matching PIDs separated by commas, which is the format -p expects.
Troubleshooting
htop: command not found: htop isn’t installed. Install it with the command for your distribution above. On RHEL, Rocky and AlmaLinux, enable EPEL first.- Function keys open a terminal menu instead: use the letter shortcuts (
h,S,/,\,t,k,q), or click the labels at the bottom of the screen. - Kill or renice does nothing: you are trying to change another user’s process. Quit and start
sudo htop. - Strange characters instead of lines and bars: the terminal doesn’t handle Unicode. Start htop with
htop -Uto use plain ASCII. - Each process appears many times: you are seeing its threads. Press
Hto hide user threads.
FAQ
What is htop in Linux?
htop is a free, open-source, interactive process viewer. It shows running processes and CPU, memory and swap usage in real time, and lets you sort, search, filter and kill processes from the keyboard or the mouse.
How do I exit htop?
Press q or F10. Ctrl+C also closes it.
How do I install htop?
Use your package manager: sudo apt install htop on Ubuntu and Debian, sudo dnf install htop on Fedora (and on RHEL, Rocky Linux or AlmaLinux after enabling EPEL), sudo pacman -S htop on Arch, or brew install htop on macOS.
Is htop better than top?
For interactive use, usually yes: it scrolls, supports the mouse, shows a tree view and lets you kill or renice processes without typing PIDs. top is still useful because it is installed on almost every system and works well in batch mode (top -b) for scripts.
Why is the memory bar almost full?
Most likely it is cache (the yellow/orange part). Linux uses free RAM to cache files and releases it as soon as programs need memory. Look at the green part, which is memory actually used by programs.
How do I filter htop by user?
Press u inside htop and pick the user, or start it with htop -u username.
Is there htop for Windows?
No. You can run htop inside WSL on Windows 10 and 11, but it shows only the Linux processes in WSL. For Windows programs, use Task Manager or Resource Monitor.
Conclusion
htop gives you a live, readable view of what your Linux system is doing and lets you act on it in a keystroke: P and M to find the busiest processes, F4 to filter, F5 for the tree, and F9 to kill. For a quick text-only check on a minimal server, the top command cheat sheet covers the tool that is always there.
How did it make you feel?
