netstat -na | grep ESTAB | grep 80 | wc -l
netstat -na | grep ESTAB | grep 8080 | wc -l
<Connector port=”8080″ maxThreads=”150″ minSpareThreads=”25″ 。。。。。
linux 下查看连接数
1)统计80端口连接数
netstat -nat | grep -i "80" | wc -l
2)统计httpd协议连接数
ps -ef | grep httpd | wc -l
1
3)、统计已连接上的,状态为“established’
netstat -na | grep ESTABLISHED | wc -l
2
4)、查出哪个IP地址连接最多,将其封了。
netstat -na | grep ESTABLISHED | awk '{print$5}' | awk -F : '{print$1}' | sort | uniq -c | sort -r
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAdgAAABpCAYAAACZODL9AAAcPklEQVR4Ae1dMXbcOrKF/vnBDyeUo9ESHMrRaAl+keRovASFdjTnR3LoJTizFD3v4OlFVuglaCIrfOFkPSiyi7wsAiDIJptg+/IcCQRQVai6IKsAEGSf7fzheBABIkAEiAARIAKzIvA/s0qjMCJABIgAESACRKBCgAGWFwIRIAJEgAgQgQUQYIBdAFSKJAJEgAgQASLAAMtrgAgQASJABIjAAggwwC4AKkUSASJABIgAEWCA5TVABIgAESACRGABBBhgFwCVIokAESACRIAIMMDyGiACRIAIEAEisAACDLALgEqRRIAIEAEiQAQYYHkNEAEiQASIABFYAIEyAuzLvbs5O3Nn/u/m/qVn5tOnuu7TU6/qSAUv7v6m1uHs5t71NTxEjVp2jm0v9zcVRmdnn9ySUCjeob7oWap9l2NAj5kFRIAIEIHTRaCIAPvy+M097DF+ePfKnXWc9ZN7/FhXfnwjQW7Z4DLY1Q/v3KtZdXh2z974HNuehbA6Pro3fjDSgWlQ8VyCF/f8o6at+mLA1qbvPr6pgv8yOuXqTjoiQASIQDkIFBBgX9zjNw0czt1937ndh8sGoZf7z24fX527vnbX7od7nncK2bSVd3Lnvu8+uFbDENd+xpsVbS7dh913d1eJqQNneObYDjQ8EO7rz50DmEJKTCyrA37NPGxrG/Rrjh/rds5Em8lGBIgAEZgfgfUD7NMX907j6913EzQw+Pqg8vne3e/8cvL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V21I6Ta1cpQ3xWlrmiQAR2A4CJ/GD6+K48FCHhWWHnMcco8jUtm2byqOpbR/LY+cqPybbyiwlj/ZM1akUGVZ/1UtTW695rdcUy/V8KLX9PkTPeiJABMpC4CQCbFmQUhsiQASIABEgAs6d7A+us3OJABEgAkSACKyJAAPsmuizbSJABIgAEThZBBhgT7ZraRgRIAJEgAisicB/AbuSjorNI1JbAAAAAElFTkSuQmCC" alt="" />
netstat - na | grep SYN | awk '{print$5}' | awk -F : '{print$1}' | sort | uniq -c | sort -r +0n
netstat -nlap|grep 27017 |awk '{print $5}'|awk -F ":" '{print $1}' |sort |uniq -c |sort -t " " -k 1 -n
今天的文章简单命令挺有用的分享到此就结束了,感谢您的阅读。
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/63129.html