Skip to content

Instantly share code, notes, and snippets.

@defunkt
Created July 22, 2010 19:20
Show Gist options
  • Save defunkt/486445 to your computer and use it in GitHub Desktop.
Save defunkt/486445 to your computer and use it in GitHub Desktop.
murder processes matching a pattern
# 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
}
@pvdb
Copy link

pvdb commented Jul 22, 2010

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)

@defunkt
Copy link
Author

defunkt commented Jul 22, 2010

Don't ever sudo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment