Monitoring Linux systems is one of the most important of system administrators. There are a lot of different monitoring tools that provide different features. We will look in detail those Linux system monitoring software in this tutorial.
监视Linux系统是最重要的系统管理员之一。 有许多不同的监视工具提供不同的功能。 在本教程中,我们将详细介绍那些Linux系统监视软件。
最佳 (Top)
The top is the most used, fast simple tool to monitor Linux system resources. It can be easily invoked like below. top
command is provided by procps-ng package.
顶部是监视Linux系统资源的最常用,快速的简单工具。 可以像下面这样轻松地调用它。 top
命令由procps-ng软件包提供。
$ top
![Top](https://i-blog.csdnimg.cn/blog_migrate/8259bfbe2d73187f6e5cf9d9a874f061.png)
By default, processes are sorted by their PID number.
默认情况下,进程按其PID编号排序。
帮帮我 (Help)
To get help h is used. top
command help page provides simple and fast information about commands. Information like kill, renice, locate column, toggle sorting, toggle summary, add remove fields
为了获得帮助,使用了h 。 top
命令帮助页面提供有关命令的简单快速信息。 诸如kill,renice,locate列,切换排序,切换摘要,添加删除字段之类的信息
h
![Help](https://i-blog.csdnimg.cn/blog_migrate/abb40ebe352a6d79308d8a6a67633c67.png)
排序(Sorting)
To sort according to CPU usage use c
. The calculation of CPU usage is done withing 2-second intervals. So some process may change position according to their load for 2 second period.
要根据CPU使用率进行排序,请使用c
。 CPU使用率的计算间隔为2秒。 因此,某些过程可能会根据其负载在2秒钟内更改位置。
c
![Sorting](https://i-blog.csdnimg.cn/blog_migrate/1f70c61c9f04100aeae8eae5d8d680ae.png)
内存图(Memory Graph)
Show memory information in different ways like bar graph use m
.
以不同的方式显示内存信息,例如条形图使用m
。
m
![Memory Graph](https://i-blog.csdnimg.cn/blog_migrate/5ee6893ed7f19db20b912feb10f42c06.png)
根据用户名过滤流程(Filter Process According To Username)
Filter process according to their owner user use u and put user name like. We will get the following line after pressing u and then enter a username where in this example ismail
.
过滤过程根据所有者用户使用u并放入用户名之类的。 按下u后,我们将获得以下行,然后输入用户名,在此示例中为ismail
。
u
Which user (blank for all) ismail
![Filter Process According To Username](https://i-blog.csdnimg.cn/blog_migrate/09a0185922e6f99bc05f58501dee170f.png)
杀死过程(Kill Process)
Kill process with <strong>k
and PID. Keep in mind that we need to have the required privileges to kill the process. We will get following like to enter PID and 3555 is our PID.
使用<strong>k
和PID终止进程。 请记住,我们需要具有所需的特权才能终止该进程。 我们将得到以下输入PID的信息,而3555是我们的PID。
k
PID to signal/kill [default pid = 4122] 3555
![Kill Process](https://i-blog.csdnimg.cn/blog_migrate/260e9e07624259550814fcdacf0e3ae7.png)
色彩模式(Color Mode)
Toggle to color mode to see a colorful table with z
. We can see that the white colors are turned into the red.
切换到颜色模式以查看带有z
的彩色表格。 我们可以看到白色变成了红色。
z
![Color Mode](https://i-blog.csdnimg.cn/blog_migrate/93798d11729421111b947dc1429ab6a6.png)
森林景观(Forest View)
Change view of process table like with V to forest view. In the forest, the view provides a hierarchical process view with parent and child processes. This can be useful to get the hierarchy of processes and services.
将过程表的视图(如V)更改为林视图。 在林中,该视图提供带有父流程和子流程的分层流程视图。 这对于获取流程和服务的层次结构很有用。
V
![Forest View](https://i-blog.csdnimg.cn/blog_migrate/95f4394a6e6e5aec049172b1c0f28787.png)
显示过程绝对路径(Show Process Absolute Path)
While showing process only the name of the executable is shown by default. To show the absolute path of the process c
can be used as below.
在显示进程时,默认情况下仅显示可执行文件的名称。 显示过程c
的绝对路径 可以如下使用。
c
![Show Process Absolute Path](https://i-blog.csdnimg.cn/blog_migrate/2369bbb6a5bd9f19664b605cc25a591b.png)
翻译自: https://www.poftut.com/linux-top-monitor-linux-system-resources-cpu-memory-network/