Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Script that works on mac for killing scripts that use a certain port
lsof -i:$1 | awk '{print $2}' | grep -v -e "PID" | sort -u > temp.txt
pids=`cat temp.txt`
rm temp.txt
echo "The ids: $pids"
for id in $pids; do
echo "killing $id";
kill -9 $id;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.