leonheart 发表于 2018-8-28 11:53:47

shell 截取日志 统计链接数 统计日志ip

netstat -ntu | awk -F'[ :]+' '/^tcp/{print $6}'|sort |uniq -c |sort -rn|head -5  
netstat -ntu | awk '{ print $5}' | cut -d : -f 1 | sort | uniq -c| sort -n -r | head -n 5 | grep -v 127.0.0.1"
  
netstat -ntu | tail -n +3 | awk '{ print $5}' | cut -d : -f 1 | sort | uniq -c | sort -n -r |head -n 3
  
netstat -ntu | tail -n +3 | awk '{ print $5}' | egrep -o"{1,3}.{1,3}.{1,3}.{1,3}" | sort | uniq -c | sort -n -r


页: [1]
查看完整版本: shell 截取日志 统计链接数 统计日志ip