Operations 6 min read

Mastering htop: A Complete Guide to Real-Time System Monitoring

This article explains how to use the htop command to monitor CPU, memory, load average, uptime, and detailed process information in real time, and provides a full reference of its interactive keyboard shortcuts for efficient system management.

Open Source Linux
Open Source Linux
Open Source Linux
Mastering htop: A Complete Guide to Real-Time System Monitoring
Image source: https://htop.dev/

htop is a command similar to top but with richer features and a friendlier interface, showing real‑time resource usage of processes such as CPU and memory.

When you run htop, the output looks like:

1  [|||||||                                       10.0%]     Tasks: 30, 60 thr; 2 running
  2  [||||||||                                      12.0%]     Load average: 0.29 0.33 0.47
  3  [|||||||                                       10.0%]     Uptime: 01:23:45
  4  [|||||||||                                     15.0%]
  Mem[|||||||||||||||||||||||||||||         1834/7980MB]
  Swp[                                              0/0MB]

  PID USER      PRI  NI  VIRT   RES   SHR S CPU% MEM%   TIME+  Command
    1 root       20   0  225848  9480  6812 S  0.0  0.5  00:02.03 /sbin/init
    2 root       20   0       0     0     0 S  0.0  0.0  00:00.01 [kthreadd]
    3 root       20   0       0     0     0 S  0.0  0.0  00:00.50 [ksoftirqd/0]
    ...

We then parse the output line by line:

First line: 1, 2, 3, 4: CPU core numbers (if multiple cores are present). [||||||| 10.0%]: graphical bar showing each core’s usage; in this example CPU 1 uses 10 %.

Second line: Tasks: 30, 60 thr; 2 running: shows the number of processes, threads, and how many are running. Load average: 0.29 0.33 0.47: system load averages over the past 1, 5, 15 minutes. Uptime: 01:23:45: how long the system has been up.

Third line: Mem[||||||||||||||||||||||||||||| 1834/7980MB]: memory usage bar; 1834 MB used of 7980 MB total. Swp[ 0/0MB]: swap usage; none configured.

Subsequent lines list each process with columns such as PID, USER, PRI, NI, VIRT, RES, SHR, S, CPU%, MEM%, TIME+, and Command, describing their IDs, owners, priorities, memory consumption, state, CPU usage, etc.

In the interactive htop interface, you can use the following keys: F1, h or ?: show help. q or F10: quit htop. F2 or S: open settings to configure display options and colors. F3 or /: search for a process. F4 or \: filter processes. F5 or t: toggle tree view. F6 or < or >: change sorting column. F7 or [: lower the selected process’s priority (increase nice). F8 or ]: raise the selected process’s priority (decrease nice). F9 or k: kill the selected process. Space: mark or unmark a process. u: unmark all processes.

Appendix:

https://github.com/htop-dev/htop

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

process managementLinuxcommand-linehtop
Open Source Linux
Written by

Open Source Linux

Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.