Skip to content

Instantly share code, notes, and snippets.

@knadh
Created September 10, 2017 07:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save knadh/1cea393f9613bfe786e92be647419cb0 to your computer and use it in GitHub Desktop.
Save knadh/1cea393f9613bfe786e92be647419cb0 to your computer and use it in GitHub Desktop.
Group and list all TCP connections (local address) by port and number of connections
netstat -ntu | awk ' $4 ~ /^[0-9]/ {print $4}' | sort | uniq -c | sort -n
# Rehashed from http://www.commandlinefu.com/commands/view/8767/netstat-with-group-by-ip-adress
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment