歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> 關於Linux

TOP中只查看某個或某些進程的信息

例: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

 

Copyright © Linux教程網 All Rights Reserved