Created
September 6, 2016 04:43
-
-
Save BadgerBadgerBadgerBadger/8769ae300d312e0797a776eacc796f5e to your computer and use it in GitHub Desktop.
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
# Kills the process running at the port passed into the argument. | |
# `lsof -i :${1}` gets the processes running at the specified port. | |
# `awk NR==2` gets the second line which is the first record from lsof. | |
# `awk '{print $2}')` gets the second column, which is the pid of the process. | |
# This is evaluated and the result used as the arg for the `kill` command. | |
kill $(lsof -i :${1} | awk NR==2 | awk '{print $2}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment