当前位置: 首页 > 操作系统 > Linux > 正文

TOP中只查看某个或某些进程的信息

时间:2014-06-03 CppBlog 天空

例:mysqld的信息

(1)得到mysqld进程的pid

[root@6 ~]# pidof mysqld

21538

(2)top指定查看PID

[root@6 ~]# top -p 21538

top - 09:15:06 up 30 days, 53 min, 3 users, load average: 0.07, 0.22, 0.23

Tasks: 1 total, 0 running, 1 sleeping, 0 stopped, 0 zombie

Cpu(s): 3.0%us, 6.9%sy, 0.2%ni, 89.4%id, 0.3%wa, 0.1%hi, 0.1%si, 0.0%st

Mem: 1035140k total, 994888k used, 40252k free, 383072k buffers

Swap: 2048248k total, 80k used, 2048168k free, 237456k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND

21538 mysql 15 0 146m 21m 4372 S 0.0 2.1 3:03.84 mysqld

2、查看某些进程的信息

例:mysqld/httpd的信息

(1)得到mysqld/httpd进程的pid

[root@6 ~]# pidof mysqld

21538

[root@6 ~]# pidof httpd

31117 31116 31115 31114

(2)top指定查看PID

[root@6 ~]# top -p 21538,31117,31116,31115,31114

查看本栏目更多精彩内容:http://www.bianceng.cn/OS/Linux/