为什么b排除grep中的进程?

  • 本文关键字:进程 grep 排除 grep
  • 更新时间 :
  • 英文 :


我可以grep我的进程:

ladislav@cool:~$ ps aux | grep "node example.js"
ladislav   18231  0.1  0.3 11116444 50812 ?      Ssl  22:46   0:00 node example.js server m 0 found
ladislav   18257  0.0  0.0  11600   712 pts/0    S+   22:49   0:00 grep --color=auto node example.js

但是我想去掉第二行。我尝试了下面的命令,它可以工作:

ladislav@cool:~$ ps aux | grep "bnode example.js"
ladislav   18231  0.0  0.3 11116444 50812 ?      Ssl  22:46   0:00 node example.js server m 0 found

有人能解释一下它是如何工作的吗?我不明白。我认为它不应该工作。

最好这样做:

pgrep -fl node example.js

它是专门为这个任务设计的。

最新更新