netstat -an | \ perl -ne 'if (/(TIME|FIN|EST|SYN|CLO)\S*/) { $s = $&; $h{$s}++; } END { print map { "$_ = $h{$_}\n" } keys(%h); }' [download]
netstat -an | perl -lne' $h{$1}++ if /((?:TIME|FIN|EST|SYN|CLO)\S*)/; END { print "$a = $b" while ($a, $b) = each %h } ' [download]
Makeshifts last the longest.