Created
July 24, 2017 21:13
-
-
Save joeSaad/ba7a0b1f132648688be4ce05b54dfed0 to your computer and use it in GitHub Desktop.
terminate server running at certain port by just typing killport <portnumber> ... create this as a shell script, chmod 700 killport and place it in your /usr/local/bin folder
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
lsof -i:$1 | grep LISTEN | awk '{print $2}' | xargs kill -9 | |
echo "port $1 has been terminated" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment