Skip to content

Instantly share code, notes, and snippets.

@defunkt
Created July 22, 2010 19:20
Show Gist options
  • Select an option

  • Save defunkt/486445 to your computer and use it in GitHub Desktop.

Select an option

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

pvdb commented Jul 22, 2010

Copy link
Copy Markdown

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

defunkt commented Jul 22, 2010

Copy link
Copy Markdown
Author

Don't ever sudo.

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