使用 grep 查找进程的技巧

Aiur · Zellux at 
使用 grep 在 ps aux 的输出结果中查找进程的时候经常会把 grep 进程本身也找出来,比如查找 emacs 进程:$ ps aux | grep emacswyx 7090 0.0 0.0 3336 796 pts/2 S+ 04:49 0:00 grep emacswyx 10128 0.1 4.9 66904 50388 pts/3 S+ Jan21 2:21 emacs 一个常见的防止 grep 进程出现的方法就是在后面再加一个 grep -v grep:$ ps aux | grep emacs | grep -v grepwyx 10128 0……