Skip to content

Instantly share code, notes, and snippets.

@allmarkedup
Forked from xdesro/killport.sh
Created January 6, 2026 20:08
Show Gist options
  • Select an option

  • Save allmarkedup/62a728d4ba07a6cd7fc185353ac88fe5 to your computer and use it in GitHub Desktop.

Select an option

Save allmarkedup/62a728d4ba07a6cd7fc185353ac88fe5 to your computer and use it in GitHub Desktop.
Kill processes at a given port.
function killport {
echo '🚨 Killing all processes at port' $1
lsof -ti tcp:$1 | xargs kill
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment