I. Introduction
I believe that students who have used the Linux operating system Top
should be familiar with it. We Top
can view the CPU usage and the detailed information of each process through commands, but today I will share with you a more Top
useful process management tool htop
( High Top
).
Two, htop function introduction
htop
Is an advanced system monitoring tool that can be used to view running processes and resource usage. It provides more functions and a more friendly interface, and is often used as a substitute for top
commands , enabling users to manage processes and resources more conveniently.
Here is a summary of htop
some of the commonly used functions of the tool:
-
View process and resource usage.
-
Displays a tree structure of processes running on the system.
-
Supports mouse operations as well as keyboard shortcuts.
-
The process list can be sorted by CPU usage, memory usage, etc.
-
Each process in the process list is marked with different colors for easy identification.
-
Display the resource usage of each process, including CPU usage, memory usage, virtual memory usage, etc.
-
Can display the command line parameters of each process.
-
Display the CPU and memory usage of the system, including CPU usage, total memory, used memory, idle memory and actual available memory, etc.
-
Many shortcut keys are provided to make it more convenient for you to use, including filtering process display, refreshing display, increasing/decreasing process priority, killing process, etc.
-
Allows custom configuration, including setting display options, sorting options, color options, process filtering options, logging options, etc.
3. How to install htop?
htop
Tools are a common application in Linux systems and can usually be installed through a package manager. Debian/Ubuntu
In Red Hat/CentOS
distributions such as and , the installation methods are as follows:
Debian/Ubuntu
sudo apt-get update
sudo apt-get install htop
Red Hat/CentOS
sudo yum install epel-release
sudo yum install htop
The above command will download and install htop
the tool . After the installation is successful, you can enter the command htop
to check whether the installation is successful.
4. How to use htop?
htop
After starting , it will open its main interface by default, showing the currently running processes and the resources they occupy. Here are the key features htop
of :
-
Supports mouse operations as well as keyboard shortcuts.
-
The process list can be sorted by CPU usage, memory usage, etc.
-
Each process is marked in a different color in the process list for easy identification.
-
Display process and system resource usage in the header and bottom of the screen, including CPU and memory usage, swap space usage, and elapsed running time, etc.
4.1 htop interface description
htop
After launching , you will see its very intuitive interface. Here are the main components:
Top
The top column shows the overall status of the system, including the current time, the running time of the system, load average, CPU usage, memory usage, swap usage and other information. This section is useful when you need to understand basic system resource usage.
Process list
In the middle part, htop
it shows the status of each process in the entire system, including process ID, process status, user of the process, CPU usage, memory usage, virtual memory usage and process name. You can move the cursor up and down and select different processes with the mouse or keyboard.
Bottom The
bottom shows the CPU and memory usage of the system, including CPU usage, total memory, used memory, idle memory, and actual available memory. Also includes long-term and short-term CPU load averages.
4.2 htop shortcut key
htop
The tool provides many shortcut keys for your convenience, the following are commonly used ones:
F1 — 帮助菜单
F2 — 设置选项
F3/F4 — 筛选进程显示
F5 — 刷新显示
F6 — 切换排序方式
F7/F8 — 增加/减少进程优先级
F9 — 杀掉进程
F10 — 退出htop
4.3 htop configuration options
htop
The tool also allows you to customize the configuration to your liking. You can configure them by pressing F2
to enter the settings option. including but not limited to:
-
Display Options : Select which columns to display in the process list.
-
Sorting Options : Customize how the fields in the process list are sorted.
-
Color options : Modify the colors displayed in various states in htop.
-
Process Filtering Options : You can specify to show or hide only specific users or processes.
-
Logging Options : Enable system logging and log htop to the specified file.