Linux basics: directory name meaning, monitoring procedures

Linux file system

Common Linux directory name:

table of Contents use
/ Virtual root directory. Usually do not store files here
/bin Binary directory to store many user-level tools GUN
/boot Startup directory, store the boot file
/dev Equipment directory, Linux device nodes created here
/etc System configuration files directory
/home Home directory, Linux user directory created here
/lib Library catalog, the repository file system and applications
/media Media catalog common mount point, the removable media device
/ mnt Mount directory, another common mount point may be a mobile media device
/opt Optional directory, used to store data files and third-party software packages
/proc Course catalog, store existing hardware and the current process information
/root root user's home directory
/sbin System binaries directory, it puts a lot of GUN administrator-level tools
/run Run-time data when run directory, storage system operation
/srv Directory services, services related files stored locally
/sys System directory, file system-related hardware store information
/tmp Temporary directory, you can create and delete temporary work files in that directory
/usr Users of binary directory, a large number of user-level GUN tools and data files are stored here
/where The variable directory for storing frequently changing files, such as log files

Common directory names are based on the Filesystem Hierarchy Standard (filesystem hierarchy stanard, FHS). FHS occasionally be updated, there may be some people in the FHS Linux distributions use the old standard. The latest FHS standard can visit its official home page:
http://www.pathname.com/fhs

ps command to see the process

When the program is run on the system, called the process (process). To monitor these processes, we need to be familiar with the use of the ps command.

By default, ps command will show processes belonging to the current user running in the current console at:

$ ps
  PID TTY          TIME CMD
 4763 pts/0    00:00:00 bash
 4782 pts/0    00:00:00 ps
$ 

Here, only the current user running the bash shell (note, shell is just another process running on the system only), and the ps command itself.

GNU ps command used in the Linux system supports three different types of command line parameters:

  • Unix-style parameters, preceded by a single broken line
  • BSD-style parameters, without the first broken line
  • GNU long style parameters, preceded by the broken line bis

Unix-style parameters

Unix-style argument is inherited from the Bell Labs developed the original AT & T Unix ps command system down.
Unix-style ps command parameters:

parameter description
-A Show all processes
-N All processes and display a parameter indicative of inconsistent
-a The display control process (session leader) and all non-process processes other terminal
-d Show all processes except process control
-e Show all processes. -A should be the same
-C cmdlist Display process is included in the list of cmdlist
-G grplist Process group ID is displayed in the list of grplist
-U userlist Display the owner's user ID process userlist list
-g grplist Show session or group ID process grplist list
-p pidlist The PID process pidlist list
-s sesslist Session ID display process sesslist list
-t ttylist Display terminal ID process ttylist list
-u userlist Effective user ID is displayed in the process userlist list
-F Show more additional output (-f parameter relative terms)
-O format The default display output columns and a particular column format specified list
-M Safety information display process
-c Additional information show the process scheduler
-f Complete display output formats
-j Display task information
-l Displays a long list
-o format Show only specified by the format column
-Y Do not show marked progress (process flag, marking the progress status table)
-WITH Security label is displayed (SELinux's security context) information
-H Format to display a hierarchical process (a tree, to display the parent process)
-n namelist It defines the values ​​shown in column WCHAN
-w The wide output mode, the display is not limited width
-L Show threads in the process
-V Ps command displays the version number

Command parameter lists many, but not necessarily all. The key to using the ps command is not how much of the available parameters in mind. But just remember some of the most useful parameter combinations just fine.

ps -ef
查看系统上运行的所有进程:

$ ps -ef
UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 18:23 ?        00:00:01 /usr/lib/systemd/systemd --switched-root --system --deserialize 22
root         2     0  0 18:23 ?        00:00:00 [kthreadd]
root         3     2  0 18:23 ?        00:00:00 [ksoftirqd/0]
root         5     2  0 18:23 ?        00:00:00 [kworker/0:0H]
root         6     2  0 18:23 ?        00:00:00 [kworker/u2:0]
root         7     2  0 18:23 ?        00:00:00 [migration/0]
root         8     2  0 18:23 ?        00:00:00 [rcu_bh]
root         9     2  0 18:23 ?        00:00:00 [rcu_sched]
root        10     2  0 18:23 ?        00:00:00 [lru-add-drain]

......

root      4250     1  0 18:23 ?        00:00:00 /usr/sbin/hypervkvpd -n
root      4251     1  0 18:23 ?        00:00:00 /usr/sbin/sshd -D
root      4253     1  0 18:23 ?        00:00:01 /usr/bin/python2 -Es /usr/sbin/tuned -l -P
root      4254     1  0 18:23 ?        00:00:00 /usr/sbin/rsyslogd -n
root      4515     1  0 18:23 ?        00:00:00 /usr/libexec/postfix/master -w
postfix   4532  4515  0 18:24 ?        00:00:00 qmgr -l -t unix -u
root      4569  4251  0 18:24 ?        00:00:00 sshd: root@pts/0
root      4763  4569  0 18:24 pts/0    00:00:00 -bash
postfix   4931  4515  0 20:04 ?        00:00:00 pickup -l -t unix -u
root      4938     2  0 20:31 ?        00:00:00 [kworker/0:3]
root      4944     2  0 20:46 ?        00:00:00 [kworker/0:2]
root      4947     2  0 20:51 ?        00:00:00 [kworker/0:0]
root      4949  4763  0 20:53 pts/0    00:00:00 ps -ef
$ 

每列的信息说明:

  • UID:启动这些进程的用户
  • PID:进程的进程ID
  • PPID:父进程的进程号(如果该进程是由另一个进程启动的)
  • C:进程生命周期中的CPU利用率
  • STIME:进程启动时的系统时间
  • TTY:进程启动时的终端设备
  • TIME:运行进程需要的累积CPU时间
  • CMD:启动的程序名称

ps -el
ps -ef 最常用,而-l参数可以显示其他额外的信息,也可以ps -efl把两部分的信息都显示出来。
使用-l参数,会产生一个长格式输出:

$ ps -el
F S   UID   PID  PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD
4 S     0     1     0  0  80   0 - 32005 ep_pol ?        00:00:01 systemd
1 S     0     2     0  0  80   0 -     0 kthrea ?        00:00:00 kthreadd
1 S     0     3     2  0  80   0 -     0 smpboo ?        00:00:00 ksoftirqd/0
1 S     0     5     2  0  60 -20 -     0 worker ?        00:00:00 kworker/0:0H
1 S     0     6     2  0  80   0 -     0 worker ?        00:00:00 kworker/u2:0
1 S     0     7     2  0 -40   - -     0 smpboo ?        00:00:00 migration/0
1 S     0     8     2  0  80   0 -     0 rcu_gp ?        00:00:00 rcu_bh
1 R     0     9     2  0  80   0 -     0 -      ?        00:00:00 rcu_sched
1 S     0    10     2  0  60 -20 -     0 rescue ?        00:00:00 lru-add-drain

......

4 S     0  4250     1  0  80   0 - 10025 poll_s ?        00:00:00 hypervkvpd
4 S     0  4251     1  0  80   0 - 28215 poll_s ?        00:00:00 sshd
4 S     0  4253     1  0  80   0 - 143481 poll_s ?       00:00:02 tuned
4 S     0  4254     1  0  80   0 - 55687 poll_s ?        00:00:00 rsyslogd
5 S     0  4515     1  0  80   0 - 22412 ep_pol ?        00:00:00 master
4 S    89  4532  4515  0  80   0 - 22455 ep_pol ?        00:00:00 qmgr
4 S     0  4569  4251  0  80   0 - 39183 poll_s ?        00:00:00 sshd
4 S     0  4763  4569  0  80   0 - 28859 do_wai pts/0    00:00:00 bash
4 S    89  4931  4515  0  80   0 - 22438 ep_pol ?        00:00:00 pickup
1 S     0  4972     2  0  80   0 -     0 worker ?        00:00:00 kworker/0:0
1 S     0  4973     2  0  80   0 -     0 worker ?        00:00:00 kworker/0:3
1 S     0  4974     2  0  80   0 -     0 worker ?        00:00:00 kworker/0:1
1 R     0  4977     2  0  80   0 -     0 -      ?        00:00:00 kworker/0:2
0 R     0  4979  4763  0  80   0 - 38309 -      pts/0    00:00:00 ps
$ ^

每列的信息说明:

  • F:内核分配给进程的系统标记
  • S:进程的状态
    • O代表正在运行
    • S代表正在休眠
    • R代表可运行,正等待运行
    • Z代表僵化,进程已结束但父进程已不存在
    • T代表停止
  • PRI:进程的优先级(越大表示优先级越低)
  • NI:谦让度值用来参与决定优先级
  • ADDR:进程的内存地址
  • SZ:假如进程被换出,所需交换空间的大致大小
  • WCHAN:进程休眠的内核函数的地址

BSD风格的参数

伯克利软件发行版(Berkeley software distribution, BSD)是加州大学伯克利分校开发的一个Unix版本。
BSD风格的ps命令参数:

参数 描述
T 显示跟当前终端关联的所有进程
a 显示跟任意终端关联的所有进程
g 显示所有的进程,包括控制进程
r 仅显示运行中的进程
x 显示所有的进程,甚至包括未分配任何终端的进程
U userlist 显示归userlist列表中某用户ID所拥有的进程
p pidlist 显示PID在pidlist列表中的进程
t ttylist 显示所关联的终端在ttylist列表中的进程
O format 除了默认输出的列之外,还输出由format指定的列
X 按过去的Linux i386寄存器格式显示
Z 将安全信息添加到输出中。效果和-Z参数差不多
j 显示任务信息
l 采用长模式
o format 仅显示由format指定的列
s 采用信号格式显示
u 采用基于用户的格式显示
v 采用虚拟内存格式显示
N namelist 定义在WCHAN列中使用的值
O order 定义显示信息列的顺序
S 将数值信息从子进程加到父进程上,比如CPU和内存的使用情况
c 显示真实的命令名称(用以启动进程的程序名称)
e 显示命令使用的环境变量
f 用分层格式来显示进程、表明哪些进程启动了哪些进程
h 不显示头信息
k sort 指定用以将输出排序的列
n 和WCHAN信息一起显示出来,用数值来表示用户ID和组ID
w 为较宽屏幕显示宽输出
H 将线程按进程来显示
m 在进程后显示线程
L 列出所有格式指定符
V 显示ps命令的版本号

Unix和BSD类型的参数有很多是重复的,大多数情况下,选择自己重用的格式的参数即可。
ps aux
这个是BSD风格的显示所有进程的命令,效果类似于ps -ef,主要是展示风格不同,输出的列也有一些区别。
在使用BSD参数时,ps命令会自动改变输出以模仿BSD格式:

$ ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.3 128000  6540 ?        Ss   09:19   0:01 /usr/lib/systemd/systemd --switched-root --system --deserialize 22
root         2  0.0  0.0      0     0 ?        S    09:19   0:00 [kthreadd]
root         3  0.0  0.0      0     0 ?        S    09:19   0:00 [ksoftirqd/0]
root         5  0.0  0.0      0     0 ?        S<   09:19   0:00 [kworker/0:0H]
root         6  0.0  0.0      0     0 ?        S    09:19   0:00 [kworker/u2:0]
root         7  0.0  0.0      0     0 ?        S    09:19   0:00 [migration/0]
root         8  0.0  0.0      0     0 ?        S    09:19   0:00 [rcu_bh]
root         9  0.0  0.0      0     0 ?        R    09:19   0:00 [rcu_sched]
root        10  0.0  0.0      0     0 ?        S<   09:19   0:00 [lru-add-drain]

......

root      4256  0.0  0.0  40100  1540 ?        Ss   09:19   0:00 /usr/sbin/hypervkvpd -n
root      4258  0.0  0.2 112860  4296 ?        Ss   09:19   0:00 /usr/sbin/sshd -D
root      4259  0.0  0.4 222748  7800 ?        Ssl  09:19   0:00 /usr/sbin/rsyslogd -n
root      4261  0.0  0.9 573924 17144 ?        Ssl  09:19   0:00 /usr/bin/python2 -Es /usr/sbin/tuned -l -P
root      4503  0.0  0.1  89648  2100 ?        Ss   09:19   0:00 /usr/libexec/postfix/master -w
postfix   4516  0.0  0.2  89752  4068 ?        S    09:19   0:00 pickup -l -t unix -u
postfix   4517  0.0  0.2  89820  4096 ?        S    09:19   0:00 qmgr -l -t unix -u
root      4770  0.0  0.3 156732  5524 ?        Ss   09:28   0:00 sshd: root@pts/0
root      4774  0.0  0.1 115436  2068 pts/0    Ss   09:28   0:00 -bash
root      4829  0.0  0.0      0     0 ?        S    09:35   0:00 [kworker/0:3]
root      4887  0.0  0.0      0     0 ?        S    09:40   0:00 [kworker/0:1]
root      4901  0.0  0.0      0     0 ?        R    09:45   0:00 [kworker/0:0]
root      4903  0.0  0.1 155360  1884 pts/0    R+   09:48   0:00 ps aux
$ 

每列的信息说明:

  • VSZ:进程在内存中的大小,以千字节(KB)为单位
  • RSS:进程在未唤出时占用的物理内存
  • STAT:代表当前进程状态的双字符状态码。

BSD风格表示的进程状态码更详细。双字符码能比Unix风格输出的单字符状态码更清楚地表示进程的当前状态。
第一个字符采用了Unix分格S列相同的值,表明休眠(S)、运行(O)还是等待(R)。
第二个值进一步说明进程的状态:

  • <:该进程运行在高优先级上
  • N:该进程运行在低优先级上
  • L:该进程有页面锁定在内存中
  • s:该进程是控制进程
  • l:该进程是多线程的
  • +:该进程运行在前台

GNU长参数

最后,GNU开发人员在最近改进过的ps命令中加入了另外一些参数。其中一些复制了现有的Unix或BSD类型的参数,而另一些则提供了新功能。
GNU风格的ps命令参数:

参数 描述
--deselect 显示所有进程,除了命令行中列出的进程
--Group grplist 显示组ID在grplist列表中的进程
--User userlist 显示用户ID在userlist列表中的进程
--group grplist 显示有效组ID在grplist列表中的进程
--pid pidlist 显示PID在pidlist列表中的进程
--ppid pidlist 显示父PID在pidlist列表中的进程
--sid sidlist 显示会话ID在sidlist列表中的进程
--tty ttylist 显示终端设备号在ttylist列表中的进程
--user userlist 显示有效用户ID在userlist列表中的进程
--format format 仅显示由format指定的列
--context 显示额外的安全信息
--cols n 将屏幕宽度设置为n列
--columns n 将屏幕宽度设置为n列
--cumulative 包含已停止的子进程的信息
--forest 用层级结构显示出进程和父进程之间的关系
--headers 在每页输出是显示列的头
--no-headers 不显示列的头
--lines n 将屏幕高度设为n行
--rows n 将屏幕高度设为n排
--sort order 指定将输出按哪列排序
--width n 将屏幕宽度设为n列
--help 显示帮助信息
--info 显示调试信息
--version 显示ps命令的版本号

部分GNU长参数可以和Unix或BSD风格的参数混用来定制输出。

--forest参数 显示进程的层级信息
这么多参数中,--forest是一个很好的功能。它会显示进程的层级信息,并用ASCII字符绘出好看的效果:

$ ps -ef --forest
UID        PID  PPID  C STIME TTY          TIME CMD
root         2     0  0 09:19 ?        00:00:00 [kthreadd]
root         3     2  0 09:19 ?        00:00:00  \_ [ksoftirqd/0]

......

root      4256     1  0 09:19 ?        00:00:00 /usr/sbin/hypervkvpd -n
root      4258     1  0 09:19 ?        00:00:00 /usr/sbin/sshd -D
root      4770  4258  0 09:28 ?        00:00:00  \_ sshd: root@pts/0
root      4774  4770  0 09:28 pts/0    00:00:00      \_ -bash
root      5001  4774  0 11:12 pts/0    00:00:00          \_ ps -ef --forest
root      4259     1  0 09:19 ?        00:00:00 /usr/sbin/rsyslogd -n
root      4261     1  0 09:19 ?        00:00:01 /usr/bin/python2 -Es /usr/sbin/tuned -l -P
root      4503     1  0 09:19 ?        00:00:00 /usr/libexec/postfix/master -w
postfix   4517  4503  0 09:19 ?        00:00:00  \_ qmgr -l -t unix -u
postfix   4958  4503  0 11:00 ?        00:00:00  \_ pickup -l -t unix -u
$ 

Unix风格的-H参数也有同样的功能,但是效果没有这个好:

$ ps -efH
UID        PID  PPID  C STIME TTY          TIME CMD
root         2     0  0 09:19 ?        00:00:00 [kthreadd]
root         3     2  0 09:19 ?        00:00:00   [ksoftirqd/0]

......

root      4256     1  0 09:19 ?        00:00:00   /usr/sbin/hypervkvpd -n
root      4258     1  0 09:19 ?        00:00:00   /usr/sbin/sshd -D
root      4770  4258  0 09:28 ?        00:00:00     sshd: root@pts/0
root      4774  4770  0 09:28 pts/0    00:00:00       -bash
root      5002  4774  0 11:13 pts/0    00:00:00         ps -efH
root      4259     1  0 09:19 ?        00:00:00   /usr/sbin/rsyslogd -n
root      4261     1  0 09:19 ?        00:00:01   /usr/bin/python2 -Es /usr/sbin/tuned -l -P
root      4503     1  0 09:19 ?        00:00:00   /usr/libexec/postfix/master -w
postfix   4517  4503  0 09:19 ?        00:00:00     qmgr -l -t unix -u
postfix   4958  4503  0 11:00 ?        00:00:00     pickup -l -t unix -u
$ 

BSD风格的f参数也是这个功能,效果和--forest一样。

top 命令实时监测进程

top命令和ps命令相似,都能够显示进程信息,并且是实时的:

$ top
top - 12:01:28 up  2:41,  1 user,  load average: 0.00, 0.01, 0.05
Tasks:  97 total,   2 running,  95 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.0 us,  0.3 sy,  0.0 ni, 99.7 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem :  1816668 total,   335380 free,  1325796 used,   155492 buff/cache
KiB Swap:  2097148 total,  2097148 free,        0 used.   321636 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S %CPU %MEM     TIME+ COMMAND                                                                                
 5028 root      20   0  161880   2216   1572 R  0.3  0.1   0:00.06 top                                                                                    
    1 root      20   0  128000   6544   4136 S  0.0  0.4   0:01.12 systemd                                                                                
    2 root      20   0       0      0      0 S  0.0  0.0   0:00.00 kthreadd                                                                               
    3 root      20   0       0      0      0 S  0.0  0.0   0:00.03 ksoftirqd/0                                                                            
    5 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 kworker/0:0H                                                                           
    6 root      20   0       0      0      0 S  0.0  0.0   0:00.03 kworker/u2:0                                                                           
    7 root      rt   0       0      0      0 S  0.0  0.0   0:00.00 migration/0                                                                            
    8 root      20   0       0      0      0 S  0.0  0.0   0:00.00 rcu_bh                                                                                 
    9 root      20   0       0      0      0 S  0.0  0.0   0:00.35 rcu_sched                                                                              
   10 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 lru-add-drain                                                                          
   11 root      rt   0       0      0      0 S  0.0  0.0   0:00.11 watchdog/0                                                                             
   13 root      20   0       0      0      0 S  0.0  0.0   0:00.00 kdevtmpfs                                                                              
   14 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 netns                                                                                  
   15 root      20   0       0      0      0 S  0.0  0.0   0:00.00 khungtaskd                                                                             
   16 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 writeback                                                                              
   17 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 kintegrityd                                                                            
   18 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 bioset                                                                                 
   19 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 bioset                                                                                 
   20 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 bioset                                                                                 
   21 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 kblockd                                                                                
   22 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 md                                                                                     
   23 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 edac-poller                                                                            
   24 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 watchdogd                                                                              
   30 root      20   0       0      0      0 S  0.0  0.0   0:00.00 kswapd0                                                                                
   31 root      25   5       0      0      0 S  0.0  0.0   0:00.00 ksmd                                                                                   
   32 root      39  19       0      0      0 S  0.0  0.0   0:00.06 khugepaged                                                                             
   33 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 crypto                                                                                 
   41 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 kthrotld       

输出的第一部分显示的是系统的概况:

  • 第一行显示了当前时间、系统的运行时间、登录的用户数以及系统的平均负载。
    • 平均负载有3个值:最近1分钟的、最近5分钟的、最近15分钟的平均负载
  • 第二行显示了进程概要信息。这里将进程叫做任务(task),各种状态进程的数量:
    • total:总数
    • running:运行
    • sleeping:休眠
    • stopped:停止
    • zombie:僵化(僵化状态是指进程完成了,但父进程没有响应)
  • 第三行显示了CPU的概要信息,将CPU利用率分成几类输出:
    • us【user space】— 用户空间占用CPU的百分比。
    • sy【sysctl】— 内核空间占用CPU的百分比。
    • ni【】— 改变过优先级的进程占用CPU的百分比
    • id【idolt】— 空闲CPU百分比
    • wa【wait】— IO等待占用CPU的百分比
    • hi【Hardware IRQ】— 硬中断占用CPU的百分比
    • si【Software Interrupts】— 软中断占用CPU的百分比
  • 第四行是系统的物理内存状态:
    • total — 物理内存总量
    • free — 空闲内存总量
    • used — 使用中的内存总量
    • buff/cache — 用作内核缓存的内存量
  • 第五行是系统的交换空间状态:
    • total — 交换区总量
    • free — 空闲交换区总量
    • used — 使用的交换区总量
    • avail Mem — 缓冲的交换区总量。内存中的内容被换出到交换区,而后又被换入到内存,但使用过的交换区尚未被覆盖,该数值即为这些内容已存在于内存中的交换区的大小,相应的内存再次被换出时可不必再对交换区写入。
  • 最后一部分显示了当前运行中的进程的详细列表,有些列和ps命令的输出类似:
    • PID:进程的ID
    • USER:进程属主的名字
    • PR:进程的优先级
    • NI:进程的谦让度值(nice值)
    • VIRT:进程占用的虚拟内存总量
    • RES:进程占用的物理内存总量
    • SHR:进程和其他进程共享的内存总量
    • S:进程的状态(D可中断的休眠状态,R运行,S休眠,T跟踪状态或停止状态,Z僵化)
    • %CPU:进程使用的CPU时间比例
    • %MEM:进程使用的内存占可用内存的比例
    • TIME+:自进程启动到目前为止的CPU时间总量
    • COMMAND:进程所对应的命令行名称,也就是启动的程序名

默认情况下,top启动后按%CPU排序,可按f指定其他列。轮询时间默认是3.0秒,可按d修改。按q是退出。其他就不列举了。

结束进程

在Linux中,进程之间通过信号来通信。大多数编写完善的程序都能接收和处理标准Unix进程信号。
Linux进程信号:

信号 名称 描述
1 HUP 挂起
2 INT 中断
3 QUIT 结束运行
9 KILL 无条件终止
11 SEGV 段错误
15 TERM 尽可能终止
17 STOP 无条件停止运行,但不终止
18 TSTP 停止或暂停,但继续在后台运行
19 CONT 在STOP或TSTP之后恢复执行

kill命令
kill命令可通过进程ID(PID)给进程发信号。默认发送TERM信号。因为只能使用PID来指定,而不能用命令名,所以有时候不是很好用。
要发送信号,你还必须是该进程的属主或者是root。
kill命令不会有任何输出,要检查kill命令是由有效,可以再运行ps或top命令。

killall命令
killall命令支持通过进程名而不是PID来结束进程。killall命令也支持通配符。

Guess you like

Origin blog.51cto.com/steed/2443959