Skip to content

Instantly share code, notes, and snippets.

@victorcolina22
Created December 14, 2025 22:44
Show Gist options
  • Select an option

  • Save victorcolina22/93679d82f8189d6dc51ba97e34da1900 to your computer and use it in GitHub Desktop.

Select an option

Save victorcolina22/93679d82f8189d6dc51ba97e34da1900 to your computer and use it in GitHub Desktop.

Commands to find and kill ports running on MacOS

View ports listening

sudo lsof -nP -iTCP -sTCP:LISTEN

View port listening on port provided

lsof -i :3000

Kill port force

kill -9 $(lsof -t -i :3000)

Kill port soft

kill $(lsof -t -i :3000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment