Created
July 23, 2015 03:12
-
-
Save cadrev/3f59c73aee5602529a25 to your computer and use it in GitHub Desktop.
find-and-kill-a-process-in-one-line-using-bash-and-regex
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
PORT_NUMBER=1234 | |
lsof -i tcp:${PORT_NUMBER} | awk 'NR!=1 {print $2}' | xargs kill |
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
kill $(ps aux | grep '[p]ython csp_build.py' | awk '{print $2}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment