$ ps aux | grep terminal user 2064 0.0 0.6 181452 26460 ? Sl Feb13 5:41 gnome-terminal --working-directory=.. user 2979 0.0 0.0 4192 796 pts/3 S+ 11:07 0:00 grep --color=auto terminal
可以使用下面方法,就可以去掉grep --color=auto terminal這一行的顯示
$ ps aux | grep '[t]erminal'
user 2064 0.0 0.6 181452 26460 ? Sl Feb13 5:41 gnome-terminal --working-directory=..
參考自
http://stackoverflow.com/questions/9375711/more-elegant-ps-aux-grep-v-grep
http://unix.stackexchange.com/questions/74185/how-can-i-prevent-grep-from-showing-up-in-ps-results