This can prevent 'grep' from showing up in ps results

来源:互联网 发布:nginx 禁止svn目录 编辑:程序博客网 时间:2024/06/04 19:22
$ ps aux  | grep terminaluser  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
原创粉丝点击