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