标签: netstat

收了一堆netstat命令,判断CC用

查看所有80端口的连接数

netstat -nat|grep -i "80"|wc -l

对连接的IP按连接数量进行排序

netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n

查看80端口连接数最多的20个IP

netstat -anlp|grep 80|grep tcp|awk '{print $5}'|awk -F: '{print $1}'|sort|uniq -c|sort -nr|head -n20
netstat -ant |awk '/:80/{split($5,ip,":");++A[ip[1]]}END{for(i in A) print A,i}' |sort -rn|head -n20

Read More 收了一堆netstat命令,判断CC用