|
From: | Eric Blake |
Subject: | Re: [Coreutils] Sort enhancement request: 1 < 1K < 1M < 1G etc. |
Date: | Fri, 08 Oct 2010 08:05:32 -0600 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100921 Fedora/3.1.4-1.fc13 Mnenhy/0.8.3 Thunderbird/3.1.4 |
On 10/07/2010 09:16 PM, 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 already exists. From the 7.5 NEWS: sort accepts a new option, --human-numeric-sort (-h): sort numbers while honoring human readable suffixes like KiB and MB etc. The latest stable version is 8.5, with 8.6 due shortly. Consider upgrading. -- Eric Blake address@hidden +1-801-349-2682 Libvirt virtualization library http://libvirt.org
[Prev in Thread] | Current Thread | [Next in Thread] |