一:netstat -an | grep -i est | grep '10.0.0.1.21' | awk '{print $5}' | cut -d'.' -f1-4 | sort | awk '{a[$1]+=1}END{for(i in a)print i,a}'
210.73.42.42 4
210.22.171.254 3
121.35.23.114 5
125.69.8.167 1
125.122.23.119 2
或者
#netstat -an | grep -i est | grep '[0-9].21\>' | awk '{print $5}' | cut -d'.' -f1-4 | sort | awk '{a[$1]+=1}END{for(i in a)print i,a}'
210.73.42.42 3
221.220.195.52 1
210.22.171.254 2
二: netstat -an | grep "ESTABLISHED" | grep "10.0.0.1.21" | awk '{print $5}' | awk -F . '{print $1"."$2"."$3"."$4}' | sort | uniq -c
1 210.22.171.254
2 210.73.42.42
阅读(750) | 评论(0) | 转发(0) |