Last active
September 26, 2019 19:19
-
-
Save npyoung/7f55165f9ce466f26e92e46aaa811231 to your computer and use it in GitHub Desktop.
Kill process on port
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
ports=$(lsof -t -i tcp:$1); | |
for port in $ports; do | |
echo "killing PID $port"; | |
kill $port; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment