Linux链接情况的统计方法
2154 点击·0 回帖
![]() | ![]() | |
![]() | (1)粗略统计80端口连接数:netstat -nat|grep -i "80"|wc -l,包含80的端口都会被统计 (2)统计httpd协议连接数:ps -ef|grep httpd|wc -l (3)统计链接最多的20个IP:netstat -na|grep ESTABLISHED|awk '{print $5}'|awk -F: '{print $1}'|sort|uniq -c|sort -r|head -20 (4)统计已连接上数量:netstat -na|grep ESTABLISHED|wc –l,同样可以查询其他状态的 (5)统计各状态链接情况:netstat -ant | awk '{print $NF}' | grep -v '[a-z]' | sort | uniq -c | |
![]() | ![]() |