Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save HarrisHan/c59f03bfb0105383c5532d1c33dfc771 to your computer and use it in GitHub Desktop.
Save HarrisHan/c59f03bfb0105383c5532d1c33dfc771 to your computer and use it in GitHub Desktop.
netstat -vanp tcp | grep 3000
sudo lsof -i tcp:3000
kill -9 PID
kill $(lsof -t -i :YOUR_PORT_NUMBER)
echo 'free-port() { kill "$(lsof -t -i :$1)"; }
kill-port() { kill -kill "$(lsof -t -i :$1)"; }' \
>> ~/.bashrc && source ~/.bashrc
cat # Concatenate and print files to stdout
| grep
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment