Created
February 12, 2020 13:39
-
-
Save IsmiKin/0457126afb4f2013b3b218e6edcc44bd to your computer and use it in GitHub Desktop.
Kill process by 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
lsof -i:3001 -Fp | head -n 1 | sed 's/^p//' | xargs kill | |
alias kbp='killByPort' | |
killByPort() { | |
lsof -i:$1 -Fp | head -n 1 | sed 's/^p//' | xargs kill | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment