Skip to content

Instantly share code, notes, and snippets.

@VladimirCores
Created September 4, 2020 10:51
Show Gist options
  • Save VladimirCores/9f3f7f4728e9ba5db84f00517854b009 to your computer and use it in GitHub Desktop.
Save VladimirCores/9f3f7f4728e9ba5db84f00517854b009 to your computer and use it in GitHub Desktop.
Kill process on TCP port
Add to ~/.bash_profile:
function killOnTCPPort () {
kill -QUIT $(sudo lsof -sTCP:LISTEN -i tcp:$1 -t)
}
Then source ~/.bash_profile and run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment