Skip to content

Instantly share code, notes, and snippets.

@carlos-ch
Created March 23, 2023 07:43
Show Gist options
  • Select an option

  • Save carlos-ch/dc32d12de2e41a9b8cead1458b7c4800 to your computer and use it in GitHub Desktop.

Select an option

Save carlos-ch/dc32d12de2e41a9b8cead1458b7c4800 to your computer and use it in GitHub Desktop.
macOS: Find PORT and kill it
// print list of listening ports
lsof -P -i TCP -s TCP:LISTEN
// OR
// process running in <PORT>
lsof -wni tcp:<PORT>
//grab PID (<PID>) from previous print and kill
kill -9 <PID>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment