Skip to content

Instantly share code, notes, and snippets.

@mrmanc
Created July 4, 2012 16:34
Show Gist options
  • Save mrmanc/3048201 to your computer and use it in GitHub Desktop.
Save mrmanc/3048201 to your computer and use it in GitHub Desktop.
summary of outbound connections netstat
netstat -n -A inet | grep -v "127\.0\.0\.1" | egrep -v "\w\s*\w\s*\w\s*[0-9.]*:(80|8080)" | awk '/tcp/ {statuses[$6]++; hosts[$5]++} END{for (status in statuses) {print status,statuses[status]}; for (host in hosts) {if(hosts[host] > max_per_host_port) {max_per_host_port = hosts[host]}}; print "max_per_host",max_per_host_port}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment