Skip to content

Instantly share code, notes, and snippets.

@davvidbaker
Last active June 6, 2017 04:09
Show Gist options
  • Save davvidbaker/09fc5526d10e0017f4b5cc05502e69a7 to your computer and use it in GitHub Desktop.
Save davvidbaker/09fc5526d10e0017f4b5cc05502e69a7 to your computer and use it in GitHub Desktop.
bash commands I forget sometimes

For explanations of all these commands with their options, see https://www.explainshell.com

Three ways to find processes using port 8080. (May need sudo.)

ss -lptn 'sport = :8080'
netstat -nlp | grep :8080
lsof -n -i :8080 | grep LISTEN
top

Tree view of processes, where hierarchal relationships are illustrated:

ps axjf # f option doesn't work on my mac

netstat command to find open ports:

netstat --listen

check syntax of nginx configuration files

nginx -t -c /etc/nginx/nginx.conf

socket statistics

ss
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment