Skip to content

Instantly share code, notes, and snippets.

@RavenHursT
Created July 13, 2018 15:30
Show Gist options
  • Save RavenHursT/d8d0900722ff474cecb66f78ef7f9ca9 to your computer and use it in GitHub Desktop.
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.
fpkill() {
lsof -i tcp:$1 | awk 'NR!=1 {print $2}' | xargs kill -9
}
@RavenHursT
Copy link
Author

Put this in your .bash_aliases or your .zshrc under the aliases section. source it, and then you can do stuff like fpkill 3000 to kill zombie process listening on 3000 :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment