I have the Apache access logs. I want a list of IPs sorted by number of accesses they have made (count) but not the count number. Just the IP addresses sorted by access counts.
I have this command I've found here:
cat access_log | awk '{print $1}' | sort -n | uniq -c | sort -nr | head -200 > output.txt
This gives an output like:
10000 66.249.79.18
10000
is the count number. I need the IP only not the count. What is the modified command then? Thanks!
Try removing the
-c
for theuniq
command. This will eliminate the first column which is the count.Full command