Created
July 13, 2018 15:30
-
-
Save RavenHursT/d8d0900722ff474cecb66f78ef7f9ca9 to your computer and use it in GitHub Desktop.
OSX Bash function/alias To Find a Process Listening on a Port and Kill It.
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
| fpkill() { | |
| lsof -i tcp:$1 | awk 'NR!=1 {print $2}' | xargs kill -9 | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Put this in your
.bash_aliasesor your.zshrcunder the aliases section.sourceit, and then you can do stuff likefpkill 3000to kill zombie process listening on3000:-)