[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Coreutils] Sort enhancement request: 1 < 1K < 1M < 1G etc.
From: |
Pádraig Brady |
Subject: |
Re: [Coreutils] Sort enhancement request: 1 < 1K < 1M < 1G etc. |
Date: |
Fri, 08 Oct 2010 15:12:17 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 |
On 08/10/10 04:16, Philip Ganchev wrote:
> It would be useful if sort could understand numeric abbreviations, for
> example 1k = 1,000 and 1K = 1024. This need arises for me very often
> when I want a sorted list of human-readable file sizes like the output
> of "du -h". Currently, to use "sort" you have to resort to raw
> numbers, which are hard to read if they have 7 or more digits. I'm
> sure the feature would useful more generally.
>
> This feature can be implemented as part of the "--general-numeric"
> option to "sort".
>
> Alternatively, maybe coreutils should include a general program to
> parse numbers in text and re-format them, while outputting the rest of
> the text unchanged.
from the NEWS for coreutils 7.5
sort accepts a new option, --human-numeric-sort (-h): sort numbers
while honoring human readable suffixes like KiB and MB etc.
cheers,
Pádraig.