Skip to content

Instantly share code, notes, and snippets.

@cemolcay
Created August 3, 2017 08:32
Show Gist options
  • Save cemolcay/92651758b8ff7563bfbc61fe949bc58a to your computer and use it in GitHub Desktop.
Save cemolcay/92651758b8ff7563bfbc61fe949bc58a to your computer and use it in GitHub Desktop.
killport.sh
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