linux下2个检查tcp连接的命令

linux下2个检查tcp连接的命令,第1张

linux下2个检查tcp连接的命令

1 检测web服务器的链接数量状态

netstat -ant|awk '{print  "t" }'|grep "::ffff:"|sed -e 's/::ffff://' -e 's/:[0-9]*//' |sort|uniq -c| sort -rn|head -10

结果:
122 125.162.71.199 TIME_WAIT
99 79.119.125.43 TIME_WAIT
81 125.167.243.77 TIME_WAIT
75 110.137.106.75 TIME_WAIT
29 118.97.140.166 TIME_WAIT
29 115.192.138.175 TIME_WAIT
23 70.231.252.244 TIME_WAIT
22 114.58.168.27 TIME_WAIT
17 219.95.10.58 TIME_WAIT
15 125.160.90.214 TIME_WAIT


检测所有的tcp连接数量及状态

netstat -ant|awk '{print  "t" }' |grep "[1-9][0-9]*."|sed -e 's/::ffff://' -e 's/:[0-9]*//'|sort|uniq -c|sort -nr|head -10

结果:
143 79.119.125.43 TIME_WAIT
97 110.137.106.75 TIME_WAIT
54 125.162.71.199 TIME_WAIT
52 121.120.140.19 TIME_WAIT
31 114.79.21.172 TIME_WAIT
23 118.97.140.166 TIME_WAIT
19 70.231.252.244 TIME_WAIT
19 114.58.168.27 TIME_WAIT
18 219.95.10.58 TIME_WAIT
13 115.192.138.175 TIME_WAIT

有需要的朋友可以拿去收藏

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/3342944.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-10-06
下一篇 2022-10-06

发表评论

登录后才能评论

评论列表(0条)

保存