How to use the htop command to monitor system processes in real time

The htop command in Linux is a command line utility that allows users to monitor important system processes in real time.

Benefits of htop command

You can track important system resources or processes in real time. The color used in the output makes it much easier to read than the monochrome output of the top command.

Advantages of htop command are:

  1. Support mouse operation
  2. Allows you to scroll both horizontally and vertically, to view all processes and to complete the command line
  3. Lets you end a process without knowing the PID
  4. Start faster than the top command
  5. The top command requires you to enter a PID or priority value to change the priority or extend a process, and the htop does not.
How to use the htop command to monitor system processes in real time Picture 1
Benefits of htop command

Use the htop command

This command is easily called from the Command Prompt:

 # htop 

The use of the command is divided into 3 parts.

  1. In the first section (upper left corner), we see the bars that show the processor usage, the memory in use, and the swap memory (virtual RAM) in use respectively.
  2. The second part (upper right corner) displays standard information, such as task summary, load average and uptime.
  3. The last section is at the bottom, where you will see 12 columns, including:
    1. PID - Process ID
    2. USER - The process owner's username (or user ID if the name cannot be specified)
    3. PRI - The kernel's internal priority for the process
    4. NI - Nice value of a process - from low priority, 19 to high priority, -20
    5. VIRT - The total capacity of the program in memory
    6. RES - Resident Set Size (memory that the process uses)
    7. SHR - The size of the process share page
    8. S - Process status ( S - sleep / inactive, R - running, D - disk sleep / Drive sleep state, Z - zombie, T - suspended)
    9. W - Paging (memory management mechanism that allows real address spaces to allocate for scattered, discontinuous processes)
    10. CPU% - Percentage of CPU processes currently in use
    11. MEM% - Percentage of process memory currently in use
    12. TIME + - Time (calculated according to the time the process has taken of system and user time)
    13. Command - The full path of the command

As with most Linux commands, there are also options.

 # htop [-dChusv] 
  1. –D - delay (shows the delay between updates, in 1/10 seconds).
  2. –C - no-color (monochrome mode)
  3. –H - help (display the help message and exit)
  4. –U - user = USERNAME (only shows the progress of a given user)
  5. –H - pid = PID (shows only the given PID)
  6. –S - sort-key COLUMN (Sort by this column)
  7. –V - version (output and exit version information)
How to use the htop command to monitor system processes in real time Picture 2
Information htop provided

You can also use interactive commands while the command is running to change the arrangement / appearance of the window, like:

  1. Arrow, Page Up , Page Down , Home , End - Scroll the progress list
  2. Space - tag or untag a process
  3. U - Untag all processes
  4. s - keep track of system calls
  5. F1 - Help
  6. F2 - Setting
  7. F3 - Search
  8. F4 - Filter
  9. F5 - Tree view
  10. F6 - Sort
  11. F7 - Increase the priority of the selected process
  12. F8 - Decreases the priority of the selected process
  13. F9 - Destroy the process
  14. F10 - Exit ( Esc also works)

You can also sort columns simply by using the mouse.

Both new and experienced Linux users should use the man command to see all the features that the command provides.

 # man htop 
How to use the htop command to monitor system processes in real time Picture 3
Man command

This command is not only an invaluable utility for experienced Linux users' toolkit, but also useful for new Linux users, helping to better understand how Linux works and explore many interesting things. taste.

5 ★ | 3 Vote

May be interested

  • How to check whether a Linux PC is 64-bit or 32-bit by command linePhoto of How to check whether a Linux PC is 64-bit or 32-bit by command line
    how to check if your linux system is 32-bit or 64-bit? in this article, tipsmake.com will show you how to define it using the gui and the command line.
  • How to use Guake Terminal in LinuxPhoto of How to use Guake Terminal in Linux
    for many years, the terminal in linux remained unchanged. after all, there may not be much to fix or improve in a command prompt window. but guake proved this thinking wrong.
  • How to conduct IoT pentest with Kali LinuxPhoto of How to conduct IoT pentest with Kali Linux
    kali linux can be used to perform many pentest tests on computers in combination with other related techniques. the following are the penetration testing platforms and methods for iot devices related to kali linux.
  • How to detect and clean hard drive memory with QDirStat in LinuxPhoto of How to detect and clean hard drive memory with QDirStat in Linux
    qdirstat was developed from an old, tested kdirstat tool, with the purpose of presenting statistics on how computer memory is used in a human-friendly way.
  • How to use the stat command on LinuxPhoto of How to use the stat command on Linux
    the linux stat command shows you more details than the ls command. the following article will show you how to use the stat command in linux. like ls, the stat command has many options. this makes it a great candidate for the use of alias.
  • Things to know when using Linux with WaylandPhoto of Things to know when using Linux with Wayland
    the aspects of the linux desktop are always changing, but some components have existed for decades. such as the x window system (more commonly known as x). a faster and more secure alternative is being created. the alternative is wayland.