Created
July 3, 2020 16:30
-
-
Save l-portet/af59ee9abbd997535c29fb73722105ac to your computer and use it in GitHub Desktop.
Fish function that kill the process listening on a specific 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
# Fish function that kill the process listening on a specific port | |
# Usage: kill-port <port> | |
function kill-port | |
lsof -n -i:$argv | grep LISTEN | awk '{ print $2 }' | uniq | xargs kill -9 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment