Skip to content

Instantly share code, notes, and snippets.

@ashishsrivastav22
Created June 3, 2017 07:03
Show Gist options
  • Save ashishsrivastav22/430cc21d550231b64492e20811a6998d to your computer and use it in GitHub Desktop.
Save ashishsrivastav22/430cc21d550231b64492e20811a6998d to your computer and use it in GitHub Desktop.
Mac Port Killer
#!/usr/bin/env bash
echo -n "Enter Port Number."
read port
if [[ -n ${port//[0-9]/} ]]; then
echo "Invalid Port !!"
fi
lsof -i tcp:$port
processId=`lsof -ti tcp:$port`
echo $processId
kill -9 $processId
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment