netstat -n | awk '/^tcp/ {n=split($(NF-1),array,":");if(n<=2)++S[array[(1)]];else++S[array[(4)]];++s[$NF];++N} END {for(a in S){printf("%-20s %s/n", a, S[a]);++I}printf("%-20s %s/n","TOTAL_IP",I);for(a in s) printf("%-20s %s/n",a, s[a]);printf("%-20s %s/n","TOTAL_LINK",N);}'
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/1686.html