Last active
February 25, 2019 16:49
-
-
Save rasgo-cc/1052d3e1a1bf8e88921430ec207cc406 to your computer and use it in GitHub Desktop.
Kill all processes running on port passed to killport (e.g. 'killport 8080')
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
# Add this to your .zshrc file (or equivalent) | |
# Kills all processes running on a given port | |
# Usage: killport <port> | |
function killport() { | |
lsof -i:$1 | grep LISTEN | awk '{print $2}' | xargs kill -9 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment