Skip to content

Instantly share code, notes, and snippets.

@peterpham
Created October 22, 2018 06:04
Show Gist options
  • Save peterpham/898c0c64abcbaa427945fd8a4b4b6559 to your computer and use it in GitHub Desktop.
Save peterpham/898c0c64abcbaa427945fd8a4b4b6559 to your computer and use it in GitHub Desktop.
Useful command: check running processes
# list all listening ports
sudo lsof -i -P | grep -i "listen"
# list all processes using specific port - this will list all pid that using port 8080
lsof -i :8080 | grep "LISTEN"
# tell which application is running on specfic pid (for example, 1237)
ps -ef | grep 12337
# kill processes using port 8888
kill $(lsof -t -i :8888)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment