netstat 的连接状态个数统计

nestat -n | perl -lane '$h{$F[5]++ if /tcp.*/;END {print "$_=>$h{$_}}" for keys %h}'

编程技巧