September 8, 2010

Pgrep and Pkill for OSX

HappyUsually 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:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay

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

Speak Your Mind

*