Last active
August 18, 2020 02:43
-
-
Save scottshane/7d01b6f494819e2aef6a57e85da941a0 to your computer and use it in GitHub Desktop.
kill process by port number
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
killport () { | |
kill -HUP $(lsof -i :$1 | grep -v grep | tail -1 | awk '{print $2}') | |
echo Killed process on port $1 | |
lsof -i :$1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment