Share with you a Linux process management tool htop that is better than Top

I. Introduction

I believe that students who have used the Linux operating system Topshould be familiar with it. We Topcan view the CPU usage and the detailed information of each process through commands, but today I will share with you a more Topuseful process management tool htop( High Top).
insert image description here

Two, htop function introduction

htopIs 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 topcommands , enabling users to manage processes and resources more conveniently.

Here is a summary of htopsome of the commonly used functions of the tool:

  1. View process and resource usage.

  2. Displays a tree structure of processes running on the system.

  3. Supports mouse operations as well as keyboard shortcuts.

  4. The process list can be sorted by CPU usage, memory usage, etc.

  5. Each process in the process list is marked with different colors for easy identification.

  6. Display the resource usage of each process, including CPU usage, memory usage, virtual memory usage, etc.

  7. Can display the command line parameters of each process.

  8. Display the CPU and memory usage of the system, including CPU usage, total memory, used memory, idle memory and actual available memory, etc.

  9. 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.

  10. Allows custom configuration, including setting display options, sorting options, color options, process filtering options, logging options, etc.

insert image description here

3. How to install htop?

htopTools are a common application in Linux systems and can usually be installed through a package manager. Debian/UbuntuIn Red Hat/CentOSdistributions 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 htopthe tool . After the installation is successful, you can enter the command htopto check whether the installation is successful.
insert image description here

4. How to use htop?

htopAfter starting , it will open its main interface by default, showing the currently running processes and the resources they occupy. Here are the key features htopof :

  • 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

htopAfter 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, htopit 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

htopThe 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

htopThe tool also allows you to customize the configuration to your liking. You can configure them by pressing F2to 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.

insert image description here

Guess you like

Origin blog.csdn.net/qq_45172832/article/details/130362491