Skip to content

Instantly share code, notes, and snippets.

@ayamflow
Created December 22, 2020 13:31
Show Gist options
  • Save ayamflow/095de6d820cc2886b7d80eb7d714c074 to your computer and use it in GitHub Desktop.
Save ayamflow/095de6d820cc2886b7d80eb7d714c074 to your computer and use it in GitHub Desktop.
kill process blocking a port in sh
lsof -i tcp:<port>
kill -9 <pid>
# Using port 8000 for example:
lsof -i tcp:8000
# This will list all the processes using this port with their PID
node 15248 admin ....
kill -i 15248
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment