Linux command-uniq deduplication

uniq: Deduplication
option:
-c: After deduplication, count the number of occurrences. When deduplication, it must be sorted first, because uniq can only deduplicate the adjacent ones.

View the ip of the top 10 visits in the log
awk'{print $1}' access.log | sort | uniq -c | sort -k 1 -nr | head -10 #The default is 10 lines

Guess you like

Origin blog.51cto.com/paitoubing/2544467