Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

18
  • 39
    @acolyte: The output from ps will include a line ending with grep [f]nord. However, that line will not make in through the grep filter, because the string [f]nord does not match the regular expression [f]nord. Commented Apr 30, 2013 at 17:58
  • 11
    @LarsH interesting, thanks! i would have suggested ps aux | grep fnord | grep -v grep ...which seems to have already been suggested by a few people...lol Commented Apr 30, 2013 at 18:16
  • 6
    @progo Yes, you do need to quote the [ even in bash. Try it with a file called fnord in the current directory. Commented May 1, 2013 at 22:18
  • 27
    Grepping the output of ps may be an old trick, but it's unreliable. Use pgrep if available. Commented May 1, 2013 at 22:19
  • 9
    @naxa Imagine you have a program call fnord and a program called safnorde. Or there's a user called bfnord, and you end up killing all his processes. Etc. Commented Nov 24, 2013 at 22:37