-
-
Save MMTE/5b8613890271e1cf23eed6e5eecfa239 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