ss -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n
returns:
1 Local 2 [fe80 4 127.0.0.1 23 192.168.1.69
NOTE: ss is the newer replacement for the netstat command.