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:
- Support mouse operation
- Allows you to scroll both horizontally and vertically, to view all processes and to complete the command line
- Lets you end a process without knowing the PID
- Start faster than the top command
- 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.

Use the htop command
This command is easily called from the Command Prompt:
# htop
The use of the command is divided into 3 parts.
- 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.
- The second part (upper right corner) displays standard information, such as task summary, load average and uptime.
- The last section is at the bottom, where you will see 12 columns, including:
- PID - Process ID
- USER - The process owner's username (or user ID if the name cannot be specified)
- PRI - The kernel's internal priority for the process
- NI - Nice value of a process - from low priority, 19 to high priority, -20
- VIRT - The total capacity of the program in memory
- RES - Resident Set Size (memory that the process uses)
- SHR - The size of the process share page
- S - Process status ( S - sleep / inactive, R - running, D - disk sleep / Drive sleep state, Z - zombie, T - suspended)
- W - Paging (memory management mechanism that allows real address spaces to allocate for scattered, discontinuous processes)
- CPU% - Percentage of CPU processes currently in use
- MEM% - Percentage of process memory currently in use
- TIME + - Time (calculated according to the time the process has taken of system and user time)
- Command - The full path of the command
As with most Linux commands, there are also options.
# htop [-dChusv]
- –D - delay (shows the delay between updates, in 1/10 seconds).
- –C - no-color (monochrome mode)
- –H - help (display the help message and exit)
- –U - user = USERNAME (only shows the progress of a given user)
- –H - pid = PID (shows only the given PID)
- –S - sort-key COLUMN (Sort by this column)
- –V - version (output and exit version information)

You can also use interactive commands while the command is running to change the arrangement / appearance of the window, like:
- Arrow,
Page Up
,Page Down
,Home
,End
- Scroll the progress list - Space - tag or untag a process
U
- Untag all processess
- keep track of system callsF1
- HelpF2
- SettingF3
- SearchF4
- FilterF5
- Tree viewF6
- SortF7
- Increase the priority of the selected processF8
- Decreases the priority of the selected processF9
- Destroy the processF10
- 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

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.
You should read it
- Instructions for using pstree command on Linux
- 11 uses of ps command in Linux
- The best applications to monitor system performance on Android
- Use the Top command to see the processes running in Linux
- How to fix the problem of too many background processes running on Windows PC
- How to monitor network connections in Linux with pktstat
- How to generate a system performance report in Windows 10
- How to run a program periodically using the Watch command on Linux
May be interested
- Use the Top command to see the processes running in Linuxthe top command in linux is used to display all processes running in the linux environment. this tutorial shows you how to use the top command through explaining the various parameters available and the content they display.
- How to monitor network usage for Linux processesinternet access is essential, but you may be wondering which linux processes use your connection the most on your computer.
- How to fix the problem of too many background processes running on Windows PCthe windows operating system is very large, with many applications, processes and services running simultaneously. these apps may not be visible to you in desktop view, but you can simply open task manager to discover the many processes running in the background.
- Monitor Hyper-V with the command line (Part 1): Install the monitoring libraryone of the obvious shortcomings of hyper-v is the ability to monitor virtual machines from windows powershell. although microsoft intends to provide this capability on windows server 8, users can fully monitor virtual machines from the command line interface at this time. the article will guide you to do this
- How to Install and Use Grafana for Real-Time Data Visualizationthis tutorial will show you how to install grafana using docker and how to use this tool to monitor system metrics and visualize real-time data effectively.
- System () function in Cthe int system (const char * command) function passes the command name or program name specified by the command to the host environment to be executed by the command processor and returned after the command is completed.
- How to use the Netstat command in Windows 11 to monitor network activitynetstat is a command-line utility that helps you monitor all the technical characteristics of your active network connections.
- 10 useful commands in Windows you should knowcommand prompt is used to execute batch files, perform tasks quickly, help you troubleshoot and solve some windows problems when the system crashes. however, not all commands in windows are useful and must be done regularly. with the 10 command lines in the following article it is very useful even if you are not an administrator.
- How to use the Linux command line on Android with Termuxandroid is a very operating system 'capacity with more and more desktop accessibility applications. however, sometimes you want to make some things on android that can be as easy as desktop. fortunately, you can use the termux tool, which builds on the existing infrastructure and provides a command line environment that allows you to install real linux applications on your android device.
- Instructions for managing programs in Ubuntu via the command lineas we all know, ubuntu has a lot of tools to support graphic delivery to install software and applications inside the system, but users have to search. however, for those who love and have spent a lot of time using this open source operating system, the process of handling and manipulating the command line simply through the keyboard will be much faster and save time. .