Show connections per destination for a specific port


PORT=5432; netstat -an |grep ":${PORT} " | \
awk '{count[$5]++} END {for (host in count) print host, count[host]}'

To view the same over time:


PORT=5432; watch "netstat -an |grep \":${PORT} \" | \
awk '{count[\$5]++} END {for (host in count) print host, count[host]}'"

Comments

Popular posts from this blog

SSH Private Keys - RSA vs. OpenSSH

Google Wifi and Verizon FiOS