clh899 发表于 2018-8-23 06:58:03

shell 入门到精通

sort  http://www.cnblogs.com/51linux/archive/2012/05/23/2515299.html
  使用tomcat日志对访问ip进行排序
  awk '{print $1}' localhost_access_log.2016-09-30.txt |sort | uniq -c |sort -n -r
  awk -F ' ' '{print $1}' /var/www/html/apache-tomcat-7.0.27/logs/localhost_access_log.2012-12-27.txt | sort | uniq -c | sort -u
  cut -d ' ' -f1 /var/www/html/apache-tomcat-7.0.27/logs/localhost_access_log.2012-12-27.txt | sort | uniq -c | sort -u

页: [1]
查看完整版本: shell 入门到精通