Created
August 3, 2017 08:32
-
-
Save cemolcay/92651758b8ff7563bfbc61fe949bc58a to your computer and use it in GitHub Desktop.
killport.sh
This file contains hidden or 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=$1 | |
PIDS=$(lsof -t -i:$PORT) | |
for i in ${PIDS[@]} | |
do | |
kill -9 $i | |
echo "PID $i on port $PORT killed" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment