奇妙伞 Good Luck To You!

windows下netstat匹配指定值

netstat -an | findstr 3306findstr命令说明:在文件中寻找字符串。FINDSTR [/B] [/E] [/L] [/R] [/S] [/I] [/X] [/V] [/N] [/M] [/O] [/P] [/F:file]        [/C:string] [/G:file] [/D:dir list] [/A:color attributes] [/OFF[LINE]]       

netstat用法扩展

1. 统计有多少连接数netstat -an | grep ESTABLISHED | wc -l2. 统计80端口连接数netstat -nat|grep -i "80"|wc -l3. 查看不同状态的连接数数量netstat -an | awk '/^tcp/ {++y[$NF]} END {for(w in y) print w, y[w]}'