Created
September 4, 2020 10:51
-
-
Save VladimirCores/9f3f7f4728e9ba5db84f00517854b009 to your computer and use it in GitHub Desktop.
Kill process on TCP 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
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