notes/find-open-ports.sh
#find out what ports are commonly used for
cat /etc/services
grep -w 80 /etc/services
egrep -w '53/(tcp|udp)' /etc/services

#find which ports are listening
sudo lsof -i -P -n | grep LISTEN 
sudo netstat -tulpn | grep LISTEN
sudo netstat -tulpn | grep :443
sudo ss -tulpn | grep LISTEN
sudo ss -tulpn | grep ':22'


syntax highlighted by Code2HTML, v. 0.9.1