Skip to content

Instantly share code, notes, and snippets.

@chepetime
Created August 21, 2019 15:28
Show Gist options
  • Save chepetime/35bb36f08dbdce2d25c51386236dcdf9 to your computer and use it in GitHub Desktop.
Save chepetime/35bb36f08dbdce2d25c51386236dcdf9 to your computer and use it in GitHub Desktop.
Find ports and kill the process running in them
# Find all ports
sudo lsof -i -P -n | grep LISTEN
# Find a specific port
sudo lsof -i:52698
sudo lsof -i:8080
# Kill the process in a single port
fuser -k 52698/tcp
fuser -k 8080/tcp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment