Created
July 22, 2010 19:20
-
-
Save defunkt/486445 to your computer and use it in GitHub Desktop.
murder processes matching a pattern
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sh function to murder all running processes matching a pattern | |
# thanks 3n: http://twitter.com/3n/status/19113206105 | |
murder () { | |
ps | grep $1 | grep -v grep | awk '{print $1}' | xargs kill -9 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How 'bout...
sudo brew install proctools ; pkill -9 $1
;-)
(granted, it's not 100% equivalent in all cases, but close enough for all day-to-day uses)