方法: cat /var/log/nginx/access.log | awk '{print $1}' | sort | uniq -c | sort -nr |head -n10 [root@logstash nginx]# cat /var/log/nginx/access.log | awk '{print $1}' | sort | uniq -c | sort -nr |head -n1019 192.168.10.1 [root@logstash nginx]#