Skip to content

Instantly share code, notes, and snippets.

@raedatoui
Created April 25, 2012 19:39
Show Gist options
  • Save raedatoui/2492728 to your computer and use it in GitHub Desktop.
Save raedatoui/2492728 to your computer and use it in GitHub Desktop.
kill process by name in Terminal
alias kp=kill_process
kill_process(){
ps -ef | grep $@ | grep -v grep | awk '{print $2}' | xargs kill -9
}
e.g: you may have ran 'rails s &', 'gitk &', 'middleman &'
you kill with kp rails
useful to logout of all current ssh connections
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment