I\'m trying to extract IP addresses from my apache log, count them, and sort them.
And for whatever reason, the sorting part is horrible.
Here is the command
If sort isn't resulting as expected it's probably due to a locale issue.
| LC_ALL=C sort -rn
awk '{array[$1]++}END{ for (ip in array) print array[ip] " " ip}' | LC_ALL=C sort -rn
Sources sort not sorting as expected (space and locale)
https://www.commandlinefu.com/commands/view/9744/sort-ip-by-count-quickly-with-awk-from-apache-logs