netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a,S[a]}'https://www.cnblogs.com/lianzhilei/p/6025267.html