Created
September 9, 2016 08:47
-
-
Save franzese/7d788284b3b0fd13e4803bbd37e68cac to your computer and use it in GitHub Desktop.
Killport Bash Shell Script
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
#!/bin/bash | |
# How To Use: | |
# move this file to /usr/local/bin | |
# ensure script is executable `chmod +x killport` | |
# To kill any processes running on a known port use: | |
# > killport <port> | |
if [ $# -eq 0 ] | |
then | |
echo "killport: no port specified" | |
echo "usage: killport <port>" | |
exit 1 | |
fi | |
kill -9 $(lsof -ti tcp:$1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ooh kill 'em