Grep-r ' get/weixin/weixin_izp/index.html './chunyun.access.log > ~/access.log cat access.log |awk ' {print $} ' |cut-d ,-f3|sort|uniq-c > Mycount.log 1. To extract the most visited IP, you need to first extract the IP segment from the log. $ cat Aa.txt |awk-f "" ' {print $ {} ' 127.0.0.1 192.168.1.100 192.168.1.100 192.168.1.100 (PS, also available here with the Cut command.) $ cut-d ""-F 1 aa.txt 127.0.0.1 192.168.1.100 192.168.1.100 192.168.1.100) 2. Count IP to see how many times each IP has appeared $ cat aa.txt |awk-f "' {print '} ' |uniq-c 1 127.0.0.1 3 192.168.1.100 (Ps:wc-l can also count the number of rows, but the overall count is total, all rows.) Not classified statistics) 3. By IP occurrences from large to small $ cat aa.txt |awk-f "" ' {print $} ' |uniq-c |sort-r 3 192.168.1.100 1 127.0.0.1 Sort | uniq-c | Sort-nr | Head-10
Is the basic usage of counting the duplicate rows and listing the maximum number of repetitions of N Records
Number of IP occurrences in the statistics log