tag 10019 notabug On 11/11/2011 01:55 PM, Lars Noodén wrote: > Since the sort options -M and -n are incompatible, there appears to be no > easy way to sort log files.
Here is a recipe I use for sorting access_log files, which avoids numeric conversion as they're fixed width fields. sort -b -k4.9,4.12 -k4.5b,4.7Mb -k4.2,4.3 -k4.14,4 access_log Though one could use -M and -n on separate fields like `-k1,1M -k2,2n` Note also the --debug option on recent versions of sort which helps one figure this out, including subtleties like needing the b after the M even though a global -b was specified. cheers, Pádraig.
