#统计链接到的IP
netstat -n | awk '/^tcp/ {++S[$5]} END {for(a in S) print a, S[a]}'
#统计链接状态
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
#统计链接到的IP
netstat -n | awk '/^tcp/ {++S[$5]} END {for(a in S) print a, S[a]}'
#统计链接状态
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'