TOP中只檢視某個或某些程序的資訊
例:mysqld的資訊
(1)得到mysqld程序的pid
[[email protected] ~]# pidof mysqld
21538
(2)top指定檢視PID
[[email protected] ~]# 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
21538
[[email protected] ~]# pidof httpd
31117 31116 31115 31114
(2)top指定檢視PID
[[email protected] ~]# top -p 21538,31117,31116,31115,31114