Last active
July 22, 2020 20:42
-
-
Save abkosar/708be67a22b77f6ec8f09192034941c2 to your computer and use it in GitHub Desktop.
Kill processes in port range
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 | |
for i in {6023..6053} # Update the port range accordingly | |
do | |
pid=$(lsof -t -i:$i) | |
kill -9 $pid | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment