[root@new-web7 ~ 17:39:55]#netstat -na | awk '/^tcp/ {++S[$NF]} END {for(i in S) print i, S[i]}' TIME_WAIT 3460 FIN_WAIT1 17 FIN_WAIT2 6 ESTABLISHED 430 LAST_ACK 24 LISTEN 18