New to Rust? Grab our free Rust for Beginners eBook Get it free →
How to Monitor Linux Processes with Htop

A high CPU or memory reading raises a practical question: which running program is using those resources? Htop is an interactive text-mode viewer that shows system meters beside rows for individual processes.
This article explains how to read and narrow the process list, then how to check a process before sending it a signal.
TL;DR
Htop gives you a live process list with system meters, and its search, filter, sort, and tree controls help narrow down what is using resources.
- Run htop in a terminal to open the interactive viewer.
- Use F3 to search, F4 to filter, F5 for tree view, and F6 to choose a sort column.
- Read RES for resident memory, and check CPU% alongside the system-wide CPU meters.
- Use F9 only after checking the selected process and signal. Press F10 to quit.
What Is Htop Process Monitoring?
Htop is an interactive, text-mode process viewer. Its system meters show overall CPU, memory, swap, and load information alongside rows for individual processes.
A process is a running program with an identifier called a PID. Htop can display its owner, command, state, CPU use, and memory columns. Use the PID and command together to distinguish processes that share a program name.
| Display | What it tells you | How to use it |
|---|---|---|
| CPU meters | System CPU activity, often with a meter for each CPU | Compare sustained activity with a busy process row |
| MEM and Swap | System memory and swap use | Check whether overall memory pressure accompanies a large process |
| CPU% | CPU time used by one process | Sort by CPU when investigating processor load |
| RES | Resident memory held in physical RAM | Use it to compare a process’s physical memory footprint |
| VIRT | Virtual address space mapped by a process | Do not treat it as physical RAM consumption |
| PID and Command | Process identifier and command line | Confirm which program a row represents |
| State | Running, sleeping, disk sleep, zombie, or stopped | Read it alongside the CPU column and command |
For a RAM question, start with RES because it reports resident memory held in physical RAM. VIRT reports virtual address space, which can include memory that is not resident.
Read state alongside CPU use and the command before deciding that a process is stuck.
Htop can scroll vertically and horizontally, so command lines may extend beyond the terminal width. Move the process list sideways to inspect the remaining text, then match it to the PID before selecting a row.
How to Monitor Linux Processes with Htop
Open htop, identify the system-wide signal, then narrow the list by process name, resource column, or parent-child relationship. This order keeps the first check broad before you focus on a particular row.
Step 1: Check that Htop Is Available
Run the version check to confirm that the command is installed. I ran the named script in the workspace, and it returned htop 3.3.0.
sh htop_version_check.sh
pankaj@codeforgeek:~$ sh htop_version_check.sh
htop 3.3.0

The installed version can differ by distribution. If the command is missing, Debian or Ubuntu users can run the package command below. I did not run it because installation requires elevated privileges on this host.
sudo apt install htop
Step 2: Open Htop and Read the Main Areas
Start htop from a terminal. Use the arrow keys to move through the process list and inspect long command rows.
htop
Compare CPU meters with the CPU% column when investigating system load. A high system meter without a dominant row can point to activity spread across processes.
Load average is a system-level measure of runnable work over time, rather than a percentage for one process.
Step 3: Search for a Process or Filter the List
Search and filtering are separate controls. F3 finds command strings and F4 narrows the visible rows. Filter terms use case-insensitive fixed text, with the vertical bar separating multiple terms.
Choose filtering when several related rows need focused inspection. Press Escape to clear it and restore the full list.
Step 4: Sort by CPU or Memory Use
Press F6 to choose the sort field, then select CPU% or MEM% to bring the corresponding processes into view. Htop also accepts P for CPU sort and M for memory sort in its interactive view. Sorting is a good first move when the process name is unknown because it puts the resource-consuming rows where you can inspect them.
For a focused start, the command-line options can limit the displayed rows by user or PID, or choose the initial sort column. Each example is a separate invocation:
htop -u www-data
htop -p 1234,5678
htop -s PERCENT_MEM
Replace the sample account and PIDs with values from your machine. The options restrict process rows, but system meters remain context for the machine’s overall load.
The user option is useful when a shared host has unrelated services in the list. A PID filter narrows observation to known targets. The sort option helps when the question is specifically which visible row has a larger resident-memory share.
Step 5: Switch to Tree View and Inspect the Process
Tree view groups child processes beneath their parent. Press F5 to return to the previous sort view.
Check child rows individually rather than assuming the parent value totals them. That distinction matters when a service starts several processes.
Step 6: Exit or Send a Signal
Press F10 or q to quit. Select a process and press F9 to open the signal menu. Confirm the PID, owner, and command before selecting a signal.
Start with a graceful termination signal when that is the goal, and reserve a forceful signal for a process that does not respond. Avoid running the viewer with elevated privileges just to inspect processes you can already see. Permissions affect which processes you can manage and which priority changes are allowed.
Htop Process Monitoring Limits and Safe Use
For trends across past sessions, use logs or a metrics system that keeps historical measurements.
| Situation | What you may see | Next check |
|---|---|---|
| Memory meter looks high | The system meter reports overall memory categories alongside per-process RES | Sort rows by MEM% or inspect RES before identifying a process |
| Target process is missing | It may have exited, be hidden by a filter, or be outside the visible user’s processes | Clear the filter and check the user scope. Short-lived tasks can leave between refreshes. |
| Need a numeric threshold filter | F4 filters command text only | Sort by the relevant resource column, or use a separate scriptable process query |
| Tree values differ | The view shows parent-child structure | Read each row’s metrics and use a tool that calculates tree totals when needed |
| Permission denied on a process action | Your account lacks permission for that target or priority change | Confirm the owner and intent before retrying with any privilege |
Sort by the resource under investigation instead of guessing a filter threshold because htop’s interactive filter is text-based. A shorter refresh interval may help catch brief tasks. A process that starts and exits between redraws can still be missed.
Htop can show threads as separate entries, depending on its display settings. Compare process identifiers with the tree view when grouping those rows.
Conclusion: Read the Process Before Acting
After locating a candidate, compare it with the service’s own logs before changing its workload.
The official htop project README and the htop manual document command-line options and keyboard controls. Check the manual installed with your distribution when a shortcut or optional display feature differs.
- See how background Node.js services relate to the processes in a tree view.
- Review the separate process-termination guide before stopping Node.js services.
FAQ
These answers cover the two common choices that come up while reading a live process list.
How do I find a process using a lot of memory in htop?
Press F6 and sort by MEM%, then inspect the process’s RES value and command. RES is resident memory in physical RAM, while VIRT represents virtual address space.
Does htop filter processes by CPU or memory threshold?
F4 filters by matching text in process commands, not by a numeric CPU or memory threshold. Sort by CPU% or MEM% to bring resource-heavy rows into view.
How do I show the process tree in htop?
Press F5 to toggle tree view, which organizes processes by parent-child relationships. Press F5 again to return to the prior sort view.




