Skip to content

Instantly share code, notes, and snippets.

@blattmann
Created October 21, 2019 09:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blattmann/747bfc2d1000d8631f9d01316b27c7f0 to your computer and use it in GitHub Desktop.
Save blattmann/747bfc2d1000d8631f9d01316b27c7f0 to your computer and use it in GitHub Desktop.
List / Kill used ports on OSX

List a used port, e.g. 4000

$ lsof -i tcp:4000

Kill a used port, e.g. 4000

$ kill $(lsof -ti:4000)

Hints

You might have to use sudo to use any of the commands listed above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment