netstat -an | \ perl -ne 'if (/(TIME|FIN|EST|SYN|CLO)\S*/) { $s = $&; $h{$s}++; } END { print map { "$_ = $h{$_}\n" } keys(%h); }' [download]
In reply to netstate by thayer