Created
April 25, 2012 19:39
-
-
Save raedatoui/2492728 to your computer and use it in GitHub Desktop.
kill process by name in Terminal
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
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