[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Coreutils] Sort enhancement request: 1 < 1K < 1M < 1G etc.
From: |
Philip Ganchev |
Subject: |
[Coreutils] Sort enhancement request: 1 < 1K < 1M < 1G etc. |
Date: |
Thu, 7 Oct 2010 23:16:00 -0400 |
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.