Last active
August 29, 2018 17:31
-
-
Save Brantron/494a28d17b7d4b4e9f1ac8f3b400d34c to your computer and use it in GitHub Desktop.
Kill rails process on Mac from command line
This file contains hidden or 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
Put this functionin your ~/.bash_profile | |
function krails() { | |
lsof -i tcp:3000 | awk -v N=2 '{print $N}' | tail -n -2 | xargs -L1 kill -9 | |
} | |
then from the terminal reload with `source ~/.bash_profile` and you can run `krails` anytime in the terminal to kill all rails processes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment