May 17, 2012

Pgrep and Pkill for OSX

happy Pgrep and Pkill for OSXUsually I am satisfied by the commandline tools available in OSX. However, one itch that has been unfulfilled for quite a while since my permanent conversion to the Mac is the lack of “pgrep” and “pkill”, two of my favorite time savers from Linux.

Solution

sourceforge.net/projects/proctools/

Works like a dream.

[tags]osx,utilities[/tags]

Share and Enjoy:
  • services sprite Pgrep and Pkill for OSX
  • services sprite Pgrep and Pkill for OSX
  • services sprite Pgrep and Pkill for OSX
  • services sprite Pgrep and Pkill for OSX
  • services sprite Pgrep and Pkill for OSX
  • services sprite Pgrep and Pkill for OSX
  • services sprite Pgrep and Pkill for OSX
  • services sprite Pgrep and Pkill for OSX

No related posts.

About Bruce Kroeze

Comments

  1. sufehmi says:

    There’s killall instead of Pkill, but it only matches the process name from the beginning (not as substring)

    So when you ran “bash -x myscript”, then the following will not terminate it : killall myscript

    Of course, “killall bash” may not be a very wise thing to do :)

    Thanks for the tip !

  2. gabriel says:

    thanks for the suggestion!

    used “sudo port install proctools” to install. Now i can do “sudo dtruss -p $(pgrep foo)” !

  3. mat says:

    Or, if you can’t be bothered to compile proctools, emulate using the existing on-board tools. See: http://soziotechnischemassnahmen.blogspot.com/2010/03/poor-mans-pgrep-on-mac-os-x.html

  4. Robert K says:

    I highly recommend installing the “homebrew” package manager (http://mxcl.github.com/homebrew/). Much easier to deal with than macports.

    Then pkill et al can be installed via “sudo brew install procools”

Speak Your Mind

*