Created
June 19, 2024 16:21
-
-
Save deltaepsilon/39f3e62ccf92d0de5cfc24303eceb72d to your computer and use it in GitHub Desktop.
Shell function to kill processes on a port
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() { | |
if [ -z "$1" ]; then | |
echo "Usage: killport <port>" | |
return 1 | |
fi | |
lsof -ti:$1 | xargs kill -9 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment