本文最初发表于我的个人站点
1. cd (change directory) 切换目录
使用: cd [目标目录]
常用目录:
- / (根目录)
- ~ (用户目录)
- - (上一次访问的目录)
- .. (上一级目录)
2. ls (list directory contents) 列出目录内容
使用: ls [OPTION]... [FILE]...
参数:
-a, --all 列出所有文件,包括以点号开头的文件
➜ blog git:(master) ✗ ls -a
. .git _config.yml package.json source
.. .npmignore db.json public themes
.DS_Store README.md node_modules scaffolds
-A, --almost-all 列出所有文件,但不包括 . 和 ..
➜ blog git:(master) ✗ ls -A
.DS_Store .npmignore _config.yml node_modules scaffolds themes
.git README.md db.json package.json source
-h, --human-readable 与 -l 选项配合使用,以人们可读的方式而不是字节数来显示文件大小(如,1K 234M 2G)
➜ / ls -lh
total 43
drwxrwxr-x+ 134 root admin 4.4K 5 20 23:17 Applications
drwxr-xr-x+ 77 root wheel 2.6K 9 8 2016 Library
drwxr-xr-x@ 2 root wheel 68B 11 4 2015 Network
drwxr-xr-x@ 4 root wheel 136B 11 4 2015 System
drwxr-xr-x 6 root admin 204B 11 4 2015 Users
drwxrwxrwt@ 4 root admin 136B 5 20 23:18 Volumes
drwxr-xr-x@ 39 root wheel 1.3K 10 18 2015 bin
drwxrwxr-t@ 2 root admin 68B 11 4 2015 cores
drwxr-xr-x 4 root wheel 136B 3 13 13:33 data
dr-xr-xr-x 3 root wheel 4.2K 5 15 00:32 dev
lrwxr-xr-x@ 1 root wheel 11B 11 4 2015 etc -> private/etc
drwxrwxrwx 9 root wheel 306B 3 10 14:18 home
-rw-r--r--@ 1 root wheel 313B 8 23 2015 installer.failurerequests
dr-xr-xr-x 2 root wheel 1B 5 22 13:35 net
drwxrwxr-x@ 3 root wheel 102B 8 3 2015 opt
drwxr-xr-x@ 6 root wheel 204B 11 4 2015 private
drwxr-xr-x@ 59 root wheel 2.0K 11 4 2015 sbin
lrwxr-xr-x@ 1 root wheel 11B 11 4 2015 tmp -> private/tmp
drwxr-xr-x@ 13 root wheel 442B 9 8 2016 usr
lrwxr-xr-x@ 1 root wheel 11B 11 4 2015 var -> private/var
-i, --inode 显示文件的索引号
➜ blog git:(master) ✗ ls -i
46024308 README.md 45983339 node_modules 45980801 source
46055360 _config.yml 46049463 package.json 45980802 themes
46875612 db.json 45980799 scaffolds
-l 以长格式显示结果 ,也就是详细的列表形式
➜ / ls -l
total 43
drwxrwxr-x+ 134 root admin 4556 5 20 23:17 Applications
drwxr-xr-x+ 77 root wheel 2618 9 8 2016 Library
drwxr-xr-x@ 2 root wheel 68 11 4 2015 Network
drwxr-xr-x@ 4 root wheel 136 11 4 2015 System
drwxr-xr-x 6 root admin 204 11 4 2015 Users
drwxrwxrwt@ 4 root admin 136 5 20 23:18 Volumes
drwxr-xr-x@ 39 root wheel 1326 10 18 2015 bin
drwxrwxr-t@ 2 root admin 68 11 4 2015 cores
drwxr-xr-x 4 root wheel 136 3 13 13:33 data
dr-xr-xr-x 3 root wheel 4304 5 15 00:32 dev
lrwxr-xr-x@ 1 root wheel 11 11 4 2015 etc -> private/etc
drwxrwxrwx 9 root wheel 306 3 10 14:18 home
-rw-r--r--@ 1 root wheel 313 8 23 2015 installer.failurerequests
dr-xr-xr-x 2 root wheel 1 5 22 13:35 net
drwxrwxr-x@ 3 root wheel 102 8 3 2015 opt
drwxr-xr-x@ 6 root wheel 204 11 4 2015 private
drwxr-xr-x@ 59 root wheel 2006 11 4 2015 sbin
lrwxr-xr-x@ 1 root wheel 11 11 4 2015 tmp -> private/tmp
drwxr-xr-x@ 13 root wheel 442 9 8 2016 usr
lrwxr-xr-x@ 1 root wheel 11 11 4 2015 var -> private/var
-S (Size) 以大小排序(大的在最上面,降序)
➜ / ls -S
Applications home Network
dev Users cores
Library private etc
sbin System tmp
bin Volumes var
usr data net
installer.failurerequests opt
上面效果不明显,搭配-l和-h来使用更明显,可以看到最大的在上面(如下)
➜ / ls -Shl
total 43
drwxrwxr-x+ 134 root admin 4.4K 5 20 23:17 Applications
dr-xr-xr-x 3 root wheel 4.2K 5 15 00:32 dev
drwxr-xr-x+ 77 root wheel 2.6K 9 8 2016 Library
drwxr-xr-x@ 59 root wheel 2.0K 11 4 2015 sbin
drwxr-xr-x@ 39 root wheel 1.3K 10 18 2015 bin
drwxr-xr-x@ 13 root wheel 442B 9 8 2016 usr
-rw-r--r--@ 1 root wheel 313B 8 23 2015 installer.failurerequests
drwxrwxrwx 9 root wheel 306B 3 10 14:18 home
drwxr-xr-x 6 root admin 204B 11 4 2015 Users
drwxr-xr-x@ 6 root wheel 204B 11 4 2015 private
drwxr-xr-x@ 4 root wheel 136B 11 4 2015 System
drwxrwxrwt@ 4 root admin 136B 5 20 23:18 Volumes
drwxr-xr-x 4 root wheel 136B 3 13 13:33 data
drwxrwxr-x@ 3 root wheel 102B 8 3 2015 opt
drwxr-xr-x@ 2 root wheel 68B 11 4 2015 Network
drwxrwxr-t@ 2 root admin 68B 11 4 2015 cores
lrwxr-xr-x@ 1 root wheel 11B 11 4 2015 etc -> private/etc
lrwxr-xr-x@ 1 root wheel 11B 11 4 2015 tmp -> private/tmp
lrwxr-xr-x@ 1 root wheel 11B 11 4 2015 var -> private/var
dr-xr-xr-x 2 root wheel 1B 5 22 13:35 net
-t 按修改时间排序
搭配-h和-l使用如下,(时间降序,最新的在最前面)
/ ls -thl
total 43
dr-xr-xr-x 2 root wheel 1B 5 22 13:35 net
drwxrwxrwt@ 4 root admin 136B 5 20 23:18 Volumes
drwxrwxr-x+ 134 root admin 4.4K 5 20 23:17 Applications
dr-xr-xr-x 3 root wheel 4.2K 5 15 00:32 dev
drwxr-xr-x 4 root wheel 136B 3 13 13:33 data
drwxrwxrwx 9 root wheel 306B 3 10 14:18 home
drwxr-xr-x+ 77 root wheel 2.6K 9 8 2016 Library
drwxr-xr-x@ 13 root wheel 442B 9 8 2016 usr
drwxr-xr-x@ 2 root wheel 68B 11 4 2015 Network
drwxr-xr-x 6 root admin 204B 11 4 2015 Users
drwxrwxr-t@ 2 root admin 68B 11 4 2015 cores
drwxr-xr-x@ 6 root wheel 204B 11 4 2015 private
drwxr-xr-x@ 59 root wheel 2.0K 11 4 2015 sbin
lrwxr-xr-x@ 1 root wheel 11B 11 4 2015 var -> private/var
lrwxr-xr-x@ 1 root wheel 11B 11 4 2015 etc -> private/etc
lrwxr-xr-x@ 1 root wheel 11B 11 4 2015 tmp -> private/tmp
drwxr-xr-x@ 4 root wheel 136B 11 4 2015 System
drwxr-xr-x@ 39 root wheel 1.3K 10 18 2015 bin
-rw-r--r--@ 1 root wheel 313B 8 23 2015 installer.failurerequests
drwxrwxr-x@ 3 root wheel 102B 8 3 2015 opt
-r, --reverse 反序显示结果
单独使用用处不大,和上面的大小排序,或者时间排序,就可以组成按大小升序,按时间升序的效果
按大小升序
➜ / ls -rShl
total 43
dr-xr-xr-x 2 root wheel 1B 5 22 13:35 net
lrwxr-xr-x@ 1 root wheel 11B 11 4 2015 var -> private/var
lrwxr-xr-x@ 1 root wheel 11B 11 4 2015 tmp -> private/tmp
lrwxr-xr-x@ 1 root wheel 11B 11 4 2015 etc -> private/etc
drwxrwxr-t@ 2 root admin 68B 11 4 2015 cores
drwxr-xr-x@ 2 root wheel 68B 11 4 2015 Network
drwxrwxr-x@ 3 root wheel 102B 8 3 2015 opt
drwxr-xr-x 4 root wheel 136B 3 13 13:33 data
drwxrwxrwt@ 4 root admin 136B 5 20 23:18 Volumes
drwxr-xr-x@ 4 root wheel 136B 11 4 2015 System
drwxr-xr-x@ 6 root wheel 204B 11 4 2015 private
drwxr-xr-x 6 root admin 204B 11 4 2015 Users
drwxrwxrwx 9 root wheel 306B 3 10 14:18 home
-rw-r--r--@ 1 root wheel 313B 8 23 2015 installer.failurerequests
drwxr-xr-x@ 13 root wheel 442B 9 8 2016 usr
drwxr-xr-x@ 39 root wheel 1.3K 10 18 2015 bin
drwxr-xr-x@ 59 root wheel 2.0K 11 4 2015 sbin
drwxr-xr-x+ 77 root wheel 2.6K 9 8 2016 Library
dr-xr-xr-x 3 root wheel 4.2K 5 15 00:32 dev
drwxrwxr-x+ 134 root admin 4.4K 5 20 23:17 Applications
按时间升序
➜ / ls -rthl
total 43
drwxrwxr-x@ 3 root wheel 102B 8 3 2015 opt
-rw-r--r--@ 1 root wheel 313B 8 23 2015 installer.failurerequests
drwxr-xr-x@ 39 root wheel 1.3K 10 18 2015 bin
drwxr-xr-x@ 4 root wheel 136B 11 4 2015 System
lrwxr-xr-x@ 1 root wheel 11B 11 4 2015 tmp -> private/tmp
lrwxr-xr-x@ 1 root wheel 11B 11 4 2015 etc -> private/etc
lrwxr-xr-x@ 1 root wheel 11B 11 4 2015 var -> private/var
drwxr-xr-x@ 59 root wheel 2.0K 11 4 2015 sbin
drwxr-xr-x@ 6 root wheel 204B 11 4 2015 private
drwxrwxr-t@ 2 root admin 68B 11 4 2015 cores
drwxr-xr-x 6 root admin 204B 11 4 2015 Users
drwxr-xr-x@ 2 root wheel 68B 11 4 2015 Network
drwxr-xr-x@ 13 root wheel 442B 9 8 2016 usr
drwxr-xr-x+ 77 root wheel 2.6K 9 8 2016 Library
drwxrwxrwx 9 root wheel 306B 3 10 14:18 home
drwxr-xr-x 4 root wheel 136B 3 13 13:33 data
dr-xr-xr-x 3 root wheel 4.2K 5 15 00:32 dev
drwxrwxr-x+ 134 root admin 4.4K 5 20 23:17 Applications
drwxrwxrwt@ 4 root admin 136B 5 20 23:18 Volumes
dr-xr-xr-x 2 root wheel 1B 5 22 13:35 net
ll = ls -l 相当于简写
➜ / ll
total 43
drwxrwxr-x+ 134 root admin 4.4K 5 20 23:17 Applications
drwxr-xr-x+ 77 root wheel 2.6K 9 8 2016 Library
drwxr-xr-x@ 2 root wheel 68B 11 4 2015 Network
drwxr-xr-x@ 4 root wheel 136B 11 4 2015 System
drwxr-xr-x 6 root admin 204B 11 4 2015 Users
drwxrwxrwt@ 4 root admin 136B 5 20 23:18 Volumes
drwxr-xr-x@ 39 root wheel 1.3K 10 18 2015 bin
drwxrwxr-t@ 2 root admin 68B 11 4 2015 cores
drwxr-xr-x 4 root wheel 136B 3 13 13:33 data
dr-xr-xr-x 3 root wheel 4.2K 5 15 00:32 dev
lrwxr-xr-x@ 1 root wheel 11B 11 4 2015 etc -> private/etc
drwxrwxrwx 9 root wheel 306B 3 10 14:18 home
-rw-r--r--@ 1 root wheel 313B 8 23 2015 installer.failurerequests
dr-xr-xr-x 2 root wheel 1B 5 22 13:35 net
drwxrwxr-x@ 3 root wheel 102B 8 3 2015 opt
drwxr-xr-x@ 6 root wheel 204B 11 4 2015 private
drwxr-xr-x@ 59 root wheel 2.0K 11 4 2015 sbin
lrwxr-xr-x@ 1 root wheel 11B 11 4 2015 tmp -> private/tmp
drwxr-xr-x@ 13 root wheel 442B 9 8 2016 usr
lrwxr-xr-x@ 1 root wheel 11B 11 4 2015 var -> private/var
ls + 正则通配符 删选过滤
常用:
- 找出当前目录下以XXX后缀的所有文件 ls *.XXX, 可以和之前的命令选项搭配使用,下面是“找出当前目录下所有的.json"文件
[root@VM_140_109_centos ~]# ls -al *.log
-rw-r--r--. 1 root root 12754 12月 25 2014 install.log
3. grep 使用正则表达式搜索目标文件
使用: grep [OPTION] [FILE]
grep "关键字" "文件" , 在文件中寻找包含关键字的所有行
[root@VM_140_109_centos ~]# grep "rootfiles" install.log
Installing rootfiles-8.1-6.1.el6.noarch
-c (Count) 只显示统计匹配的行数
下方表示在"install.log"文件中,只有一行包含了"rootfiles"这个关键字,包含"centos"的有29行
[root@VM_140_109_centos ~]# grep "rootfiles" install.log -c
1
[root@VM_140_109_centos ~]# grep "centos" install.log -c
29
-A[-num] (After) 找出匹配关键字的行,并且把之后的-num行也显示出来
找出包含"rootfiles"的行,并把之后的1行也显示出来
[root@VM_140_109_centos ~]# grep "rootfiles" install.log -A1
Installing rootfiles-8.1-6.1.el6.noarch
*** FINISHED INSTALLING PACKAGES ***
可以看到多输出了之后的1行,就是
*** FINISHED INSTALLING PACKAGES ***
找出包含"nano"的行,并把之后的3行也显示出来
[root@VM_140_109_centos ~]# grep "nano" install.log -A3
Installing nano-2.0.9-7.el6.x86_64
Installing time-1.7-37.1.el6.x86_64
Installing attr-2.4.44-7.el6.x86_64
Installing scl-utils-20120927-8.el6.x86_64
可以看到多输出了之后的3行,就是
"Installing time-1.7-37.1.el6.x86_64
Installing attr-2.4.44-7.el6.x86_64
Installing scl-utils-20120927-8.el6.x86_64"
-B[-num] (Before) 与-A正好相反,这条命令找出匹配关键字的行,并且把之前的-num行也显示出来
找出包含"rootfiles"的行,并把之前的1行也显示出来
[root@VM_140_109_centos ~]# grep "rootfiles" install.log -B1
Installing atmel-firmware-1.3-7.el6.noarch
Installing rootfiles-8.1-6.1.el6.noarch
找出包含"nano"的行,并把之前的3行也显示出来
[root@VM_140_109_centos ~]# grep "nano" install.log -B3
Installing acl-2.2.49-6.el6.x86_64
Installing rsync-3.0.6-9.el6_4.1.x86_64
Installing ed-1.1-3.3.el6.x86_64
Installing nano-2.0.9-7.el6.x86_64
-num 直接加数字,表示除了这一行,把这行之前的-num行和之后的-num行都显示出来
把包含"install.log"中"nano"前后3行都显示出来
[root@VM_140_109_centos ~]# grep "nano" install.log -3
Installing acl-2.2.49-6.el6.x86_64
Installing rsync-3.0.6-9.el6_4.1.x86_64
Installing ed-1.1-3.3.el6.x86_64
Installing nano-2.0.9-7.el6.x86_64
Installing time-1.7-37.1.el6.x86_64
Installing attr-2.4.44-7.el6.x86_64
Installing scl-utils-20120927-8.el6.x86_64
-n 除了匹配的内容,将行号也打印出来
[root@VM_140_109_centos ~]# grep "nano" install.log -n
278:Installing nano-2.0.9-7.el6.x86_64
可以看见:278为行号
将-n与之前的命令(grep "nano" install.log -3)组合使用
[root@VM_140_109_centos ~]# grep "nano" install.log -3 -n
275-Installing acl-2.2.49-6.el6.x86_64
276-Installing rsync-3.0.6-9.el6_4.1.x86_64
277-Installing ed-1.1-3.3.el6.x86_64
278:Installing nano-2.0.9-7.el6.x86_64
279-Installing time-1.7-37.1.el6.x86_64
280-Installing attr-2.4.44-7.el6.x86_64
281-Installing scl-utils-20120927-8.el6.x86_64
可以看到278行是匹配行,后面接的是":",其他的接的是"-"
-o 只显示匹配的内容
[root@VM_140_109_centos ~]# grep "nano" install.log -o
nano
可以看见上面只显示了“nano"
上面的命令看起来没什么用,其实如果想提取一些信息-o命令还是有用的,比如提取"install.log"中所有以"yum"开头的单词,如下
[root@VM_140_109_centos ~]# grep "yum.*" install.log -o
yum-metadata-parser-1.1.2-16.el6.x86_64
yum-plugin-fastestmirror-1.1.30-14.el6.noarch
yum-3.2.29-40.el6.centos.noarch
yum-plugin-security-1.1.30-14.el6.noarch
yum-utils-1.1.30-14.el6.noarch
-w 找出完全匹配单词的行
[root@VM_140_109_centos ~]# grep "yum" install.log -w
Installing yum-metadata-parser-1.1.2-16.el6.x86_64
Installing yum-plugin-fastestmirror-1.1.30-14.el6.noarch
Installing yum-3.2.29-40.el6.centos.noarch
Installing yum-plugin-security-1.1.30-14.el6.noarch
Installing yum-utils-1.1.30-14.el6.noarch
如果带了-w ,像下面这样,只用"yu"去找,是找不到的,因为"yu"后面还有一个"m",字母还没有结束,grep认为这不是一个完整的单词
[root@VM_140_109_centos ~]# grep "yu" install.log -w
[root@VM_140_109_centos ~]#
再试一下了一下,“yum-",以及"yum-uti"和"yum-utils",证明grep只会将开头是字母和结束是字母认为是一个单词(word),类似于"yum-"这种是找不到的
[root@VM_140_109_centos ~]# grep "yum-" install.log -w
[root@VM_140_109_centos ~]# grep "yum-uti" install.log -w
[root@VM_140_109_centos ~]# grep "yum-utils" install.log -w
Installing yum-utils-1.1.30-14.el6.noarch
4. top 显示当前系统中各个进程的资源占用情况
使用 top [OPTION]
top
top命令不带任何参数就可以看见很多的系统参数
top - 00:28:40 up 31 days, 3:50, 1 user, load average: 0.02, 0.01, 0.00
Tasks: 75 total, 1 running, 74 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.1%us, 0.2%sy, 0.0%ni, 99.5%id, 0.1%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 1020344k total, 956644k used, 63700k free, 401692k buffers
Swap: 0k total, 0k used, 0k free, 314400k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1 root 20 0 19360 444 132 S 0.0 0.0 0:00.90 init
2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd
3 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/0
4 root 20 0 0 0 0 S 0.0 0.0 0:16.01 ksoftirqd/0
5 root RT 0 0 0 0 S 0.0 0.0 0:00.00 stopper/0
6 root RT 0 0 0 0 S 0.0 0.0 0:04.14 watchdog/0
7 root 20 0 0 0 0 S 0.0 0.0 2:01.70 events/0
8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cgroup
9 root 20 0 0 0 0 S 0.0 0.0 0:00.08 khelper
10 root 20 0 0 0 0 S 0.0 0.0 0:00.00 netns
11 root 20 0 0 0 0 S 0.0 0.0 0:00.00 async/mgr
12 root 20 0 0 0 0 S 0.0 0.0 0:00.00 pm
13 root 20 0 0 0 0 S 0.0 0.0 0:11.49 sync_supers
14 root 20 0 0 0 0 S 0.0 0.0 0:10.12 bdi-default
15 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kintegrityd/0
16 root 20 0 0 0 0 S 0.0 0.0 0:16.75 kblockd/0
17 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kacpid
18 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kacpi_notify
第一行
top - 00:28:40 up 31 days, 3:50, 1 user, load average: 0.02, 0.01, 0.00
- 00:28:40 当前的时间
- 31 days 从开机到现在系统运行的时间
- 1 user 系统中现在总共登录的用户数
- load average: 0.02, 0.01, 0.00 系统截止到当前 1分钟 ,5 分钟, 15分钟 的复杂情况 。
如果是1核的机器 , 1.00 代表cpu满载 ,2.00代表cpu超负荷2倍
第一行等同于命令 uptime
[root@VM_140_109_centos ~]# uptime
00:34:17 up 31 days, 3:56, 1 user, load average: 0.00, 0.00, 0.00
第二行
```bash
Tasks: 75 total, 1 running, 74 sleeping, 0 stopped, 0 zombie
- 75 total 系统目前总共运行的进程数目
- 1 running 系统目前正在运行的进程数目
- 74 sleeping 系统目前正在休眠的进程数目
- 0 stopped 系统目前处于停止状态的进程数目
- 0 zombie 系统目前僵尸进程数目
第三行
Cpu(s): 0.1%us, 0.2%sy, 0.0%ni, 99.5%id, 0.1%wa, 0.0%hi, 0.0%si, 0.0%st
系统所有cpu的运行状态, 按1可以展开,详细查看每个cpu的情况
- 0.1%us, user, 用户空间进程所占cpu百分比
- 0.2%sy, system, 内核空间进程所占cpu百分比
- 0.0%ni, nice, 改变过优先级的进程所占cpu百分比
- 99.5%id, idle ,空闲cpu百分比
- 0.1%wa, wait, 处于系统io等待进程所占cpu百分比
- 0.0%hi, Hardware interrupt, 硬中断所占cpu百分比
- 0.0%si, Software interrupt, 软中断所占cpu百分比
- 0.0%st ,Steal Time ,是当 hypervisor 服务另一个虚拟处理器的时候,虚拟 CPU 等待实际 CPU 的时间的百分比,就是你的机器可能是一台物理机器虚拟化出来的其中一台虚拟机,你实际的cpu使用需要合这台物理机上的其他虚拟机竞争cpu资源(因为物理cpu核数是固定的,能力也有限)
第四行
Mem: 1020344k total, 956644k used, 63700k free, 401692k buffers
系统目前的内存使用状况
- 1020344k total ,系统的总内存, 这里可以看到是以kb来计算 ,这里 1020344k /1024 = 996.4296875M ≈ 1G, 也就是1G内存
- 956644k used ,系统目前使用的内存总量, 956644k /1024 = 934.22265625M ,使用了934M
- 63700k free, 系统目前空闲内存, 63700k/1024=62.20703125M, 目前空闲62M
- 401692k buffers, 系统缓存的内存量, 401692k / 1024 = 392.27734375M
第五行
Swap: 0k total, 0k used, 0k free, 314400k cached
系统目前交换区使用状况
- 0k total, 交换区总量 0k
- 0k used , 使用的交换区总量 0k
- 0k free, 空闲的交换区总量 0k
- 314400k cached, 缓冲的交换区总量 314400k /1024 = 307.03125M
再往下可以看到 ,系统目前运行进程的状况
- PID 进程id
- USER 进程拥有者
- PR 进程优先级
- NI NICE值, 负值表示高优先级,正值表示低优先级
- VIRT 使用的虚拟内存总量, 以kb计算,VIRT=SWAP+RES
- RES 进程使用的、未被换出的物理内存大小,以kb计算,RES=CODE+DATA
- SHR 共享内存大小 以kb计算
- S 进程状态。D=不可中断的睡眠状态 R=运行 S=睡眠 T=跟踪/停止 Z=僵尸进程
- %CPU 距离上次更新到现在cpu的使用占比
- %MEM 进程使用的物理内存占比
- TIME+ 进程使用cpu总共的时间
- COMMAND 进程名称(命令名/命令行)