netstat -an | perl -lne' $h{$1}++ if /((?:TIME|FIN|EST|SYN|CLO)\S*)/; END { print "$a = $b" while ($a, $b) = each %h } '