Skip to content

Instantly share code, notes, and snippets.

@joeSaad
Created July 24, 2017 21:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joeSaad/ba7a0b1f132648688be4ce05b54dfed0 to your computer and use it in GitHub Desktop.
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
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