bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#10019: sort options -Mn are incompatible


From: Pádraig Brady
Subject: bug#10019: sort options -Mn are incompatible
Date: Fri, 11 Nov 2011 17:55:33 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20110816 Thunderbird/6.0

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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]