Created
June 3, 2017 07:03
-
-
Save ashishsrivastav22/430cc21d550231b64492e20811a6998d to your computer and use it in GitHub Desktop.
Mac Port Killer
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
#!/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