Created
November 23, 2021 20:49
-
-
Save JanMalch/f45f2c447a303f253eafdffb60680b00 to your computer and use it in GitHub Desktop.
Kill process by specifying the port it's listening to
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
# usage: killport 8080 | |
killport(){ | |
netstat -lpn | grep ":$1\b" | awk '{sub(/\/.*/, "", $NF); print $NF}' | xargs -i kill -9 {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment