Skip to content

Instantly share code, notes, and snippets.

@abkosar
Last active July 22, 2020 20:42
Show Gist options
  • Save abkosar/708be67a22b77f6ec8f09192034941c2 to your computer and use it in GitHub Desktop.
Save abkosar/708be67a22b77f6ec8f09192034941c2 to your computer and use it in GitHub Desktop.
Kill processes in port range
#!/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