Why does ps o/p list the grep process after the pipe?

前端 未结 7 2430
孤街浪徒
孤街浪徒 2020-12-08 20:50

When I do

$ ps -ef | grep cron

I get

root      1036     1  0 Jul28 ?        00:00:00 cron
abc    21025 14334  0 19:15 pts/2         


        
7条回答
  •  半阙折子戏
    2020-12-08 21:10

    Your actual question has been answered by others, but I'll offer a tip: If you would like to avoid seeing the grep process listed, you can do it this way:

    $ ps -ef | grep [c]ron
    

提交回复
热议问题