Linux ps同时查找多个进程

1、显示当前所有进程

SDCxM-SDCAM-root-root> ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1     0.0     0.0       2848   604 ?          Ss     00:00     0:02 init
root         2     0.0     0.0          0     0     ?          S      00:00     0:00 [kthreadd]
root         3     0.0     0.0          0     0     ?          S      00:00     0:02 [ksoftirqd/0]
root         4     0.0     0.0          0     0     ?          S      00:00     0:00 [kworker/0:0]
root         5     0.0     0.0          0     0     ?          S      00:00     0:00 [kworker/u:0]
root         6     0.0     0.0          0     0     ?          S      00:00     0:00 [posixcputmr/0]
root         7     0.0     0.0          0     0     ?          S      00:00     0:00 [migration/0]

2、同时查找多个进程,例如 kthreadd 和 migration/0 进程   

SDCxM-SDCAM-root-root> ps aux | grep -E 'kthreadd|migration/0'    //查找多个字符串的匹配(grep -E相当于egrep)
root         2  0.0  0.0      0     0 ?        S    00:00   0:00 [kthreadd]
root         7  0.0  0.0      0     0 ?        S    00:00   0:00 [migration/0]
root      6031  0.0  0.0   2856   404 pts/0    S+   04:20   0:00 grep -E kthreadd|migration/0
SDCxM-SDCAM-root-root>

 

posted @ 2013-08-12 18:22  xuefenhu  阅读(2413)  评论(0编辑  收藏  举报