awk数组

排序访问IP数量并统计连接数:

awk '{a[$1]++}END{for (i in a)  print  a[i]"\t"i}' /usr/local/nginx/logs/access.log |sort -n -k 2 -r

你可能感兴趣的:(shell,数组,awk)