GNU bug report logs - #5804
sort --human

Previous Next

Package: coreutils;

Reported by: Phil Dumont <phil <at> solidstatescientific.com>

Date: Tue, 30 Mar 2010 16:13:02 UTC

Severity: wishlist

Done: Bob Proulx <bob <at> proulx.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 5804 in the body.
You can then email your comments to 5804 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#5804; Package coreutils. (Tue, 30 Mar 2010 16:13:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Phil Dumont <phil <at> solidstatescientific.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Tue, 30 Mar 2010 16:13:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Phil Dumont <phil <at> solidstatescientific.com>
To: bug-coreutils <at> gnu.org
Subject: sort --human
Date: Tue, 30 Mar 2010 11:14:05 -0400 (EDT)
It sure would be nice if the sort command had a --human option:

  du -s --human * | sort --human

phil





Reply sent to Bob Proulx <bob <at> proulx.com>:
You have taken responsibility. (Tue, 30 Mar 2010 17:05:02 GMT) Full text and rfc822 format available.

Notification sent to Phil Dumont <phil <at> solidstatescientific.com>:
bug acknowledged by developer. (Tue, 30 Mar 2010 17:05:02 GMT) Full text and rfc822 format available.

Message #10 received at 5804-done <at> debbugs.gnu.org (full text, mbox):

From: Bob Proulx <bob <at> proulx.com>
To: Phil Dumont <phil <at> solidstatescientific.com>
Cc: 5804-done <at> debbugs.gnu.org
Subject: Re: bug#5804: sort --human
Date: Tue, 30 Mar 2010 11:04:06 -0600
Phil Dumont wrote:
> It sure would be nice if the sort command had a --human option:
>   du -s --human * | sort --human

Ask and you shall receive.  Seek and ye shall find!  (Or in this case
if you had searched you would have found it. :-)

Sort has had that option since coreutils release 7.5.  Here is the
release announcement.

  http://lists.gnu.org/archive/html/bug-coreutils/2009-08/msg00201.html

    * Noteworthy changes in release 7.5 (2009-08-20) [stable]
    ** New features
      sort accepts a new option, --human-numeric-sort (-h): sort numbers
      while honoring human readable suffixes like KiB and MB etc.

Meanwhile, coreutils release 8.4 (2010-01-13) is current and stable.

Bob




Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#5804; Package coreutils. (Tue, 30 Mar 2010 17:14:01 GMT) Full text and rfc822 format available.

Message #13 received at 5804 <at> debbugs.gnu.org (full text, mbox):

From: Eric Blake <eblake <at> redhat.com>
To: Phil Dumont <phil <at> solidstatescientific.com>
Cc: 5804 <at> debbugs.gnu.org
Subject: Re: bug#5804: sort --human
Date: Tue, 30 Mar 2010 10:55:03 -0600
[Message part 1 (text/plain, inline)]
On 03/30/2010 09:14 AM, Phil Dumont wrote:
> It sure would be nice if the sort command had a --human option:
> 
>   du -s --human * | sort --human

It does, as of coreutils 7.5.  Are you running something older?

-- 
Eric Blake   eblake <at> redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#5804; Package coreutils. (Tue, 30 Mar 2010 17:14:02 GMT) Full text and rfc822 format available.

Message #16 received at 5804 <at> debbugs.gnu.org (full text, mbox):

From: glen lenker <glen.lenker <at> gmail.com>
To: Phil Dumont <phil <at> solidstatescientific.com>
Cc: 5804 <at> debbugs.gnu.org
Subject: Re: bug#5804: sort --human
Date: Tue, 30 Mar 2010 10:08:30 -0700
Hi Phil,

Is this what you want?

http://git.savannah.gnu.org/cgit/coreutils.git/commit/?id=159faba1376ffd5a46fe4bbc780d85dd3e502cea


On Tue, Mar 30, 2010 at 8:14 AM, Phil Dumont
<phil <at> solidstatescientific.com> wrote:
> It sure would be nice if the sort command had a --human option:
>
>  du -s --human * | sort --human
>
> phil
>
>
>
>
>
>

-- 
Glen Lenker




Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#5804; Package coreutils. (Tue, 30 Mar 2010 17:14:02 GMT) Full text and rfc822 format available.

Message #19 received at 5804 <at> debbugs.gnu.org (full text, mbox):

From: Giuseppe Scrivano <gscrivano <at> gnu.org>
To: Phil Dumont <phil <at> solidstatescientific.com>
Cc: 5804 <at> debbugs.gnu.org
Subject: Re: bug#5804: sort --human
Date: Tue, 30 Mar 2010 19:13:18 +0200
sort supports --human-numeric-sort since coreutils 7.5.

Cheers,
Giuseppe



Phil Dumont <phil <at> solidstatescientific.com> writes:

> It sure would be nice if the sort command had a --human option:
>
>   du -s --human * | sort --human
>
> phil




Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#5804; Package coreutils. (Tue, 30 Mar 2010 17:51:02 GMT) Full text and rfc822 format available.

Message #22 received at 5804 <at> debbugs.gnu.org (full text, mbox):

From: Michal Svoboda <pht <at> spatium.org>
To: 5804 <at> debbugs.gnu.org, Bob Proulx <bob <at> proulx.com>
Subject: Re: bug#5804: sort --human
Date: Tue, 30 Mar 2010 19:42:06 +0200
Bob Proulx wrote 704 bytes:
>     ** New features
>       sort accepts a new option, --human-numeric-sort (-h): sort numbers
>       while honoring human readable suffixes like KiB and MB etc.

Interesting. So does it sort correctly 1 MB < 1000 KiB < 1 MiB ?




Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#5804; Package coreutils. (Tue, 30 Mar 2010 23:27:02 GMT) Full text and rfc822 format available.

Message #25 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Drake Wyrm <wyrm <at> haell.com>
To: bug-coreutils <at> gnu.org
Subject: Re: bug#5804: sort --human
Date: Tue, 30 Mar 2010 15:46:54 -0700
Michal Svoboda <pht <at> spatium.org> wrote:
> Bob Proulx wrote 704 bytes:
> >     ** New features
> >       sort accepts a new option, --human-numeric-sort (-h): sort numbers
> >       while honoring human readable suffixes like KiB and MB etc.
> 
> Interesting. So does it sort correctly 1 MB < 1000 KiB < 1 MiB ?

$ { echo 1MB; echo 1000KiB; echo 1MiB; } | sort -h
sort: both SI and IEC prefixes present on units

That would be a no to the "sort" part, but perhaps a yes to the
"correctly" part.

$ { echo 1001KiB; echo 1000KiB; echo 1MiB; } | sort -h
1000KiB
1001KiB
1MiB
$ { echo 1001KB; echo 1000KB; echo 1MB; } | sort -h
1000KB
1001KB
1MB

Seems to work fine when you give it just one type of unit to handle.

-- 
I have a firm grip on reality.  Now I can strangle it.
  -- Gordon Paynter





Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#5804; Package coreutils. (Wed, 31 Mar 2010 16:30:03 GMT) Full text and rfc822 format available.

Message #28 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Michal Svoboda <pht <at> spatium.org>
To: bug-coreutils <at> gnu.org
Subject: Re: bug#5804: sort --human
Date: Wed, 31 Mar 2010 18:28:07 +0200
Drake Wyrm wrote 796 bytes:
> Michal Svoboda <pht <at> spatium.org> wrote:
> > Bob Proulx wrote 704 bytes:
> > >     ** New features
> > >       sort accepts a new option, --human-numeric-sort (-h): sort numbers
> > >       while honoring human readable suffixes like KiB and MB etc.
> > 
> > Interesting. So does it sort correctly 1 MB < 1000 KiB < 1 MiB ?
> 
> $ { echo 1MB; echo 1000KiB; echo 1MiB; } | sort -h
> sort: both SI and IEC prefixes present on units
> 
> That would be a no to the "sort" part, but perhaps a yes to the
> "correctly" part.

Ah, this is obviously some strange use of the word *correctly* that
I wasn't previously aware of.

Michal Svoboda





Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#5804; Package coreutils. (Thu, 01 Apr 2010 06:12:01 GMT) Full text and rfc822 format available.

Message #31 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: bug-coreutils <at> gnu.org
Subject: Re: bug#5804: sort --human
Date: Thu, 01 Apr 2010 08:10:54 +0200
Michal Svoboda wrote:
> Drake Wyrm wrote 796 bytes:
>> Michal Svoboda <pht <at> spatium.org> wrote:
>> > Bob Proulx wrote 704 bytes:
>> > >     ** New features
>> > >       sort accepts a new option, --human-numeric-sort (-h): sort numbers
>> > >       while honoring human readable suffixes like KiB and MB etc.
>> >
>> > Interesting. So does it sort correctly 1 MB < 1000 KiB < 1 MiB ?
>>
>> $ { echo 1MB; echo 1000KiB; echo 1MiB; } | sort -h
>> sort: both SI and IEC prefixes present on units
>>
>> That would be a no to the "sort" part, but perhaps a yes to the
>> "correctly" part.
>
> Ah, this is obviously some strange use of the word *correctly* that
> I wasn't previously aware of.

;-)
Perhaps he meant that it works as documented:

  `-h'
  `--human-numeric-sort'
  `--sort=human-numeric'
       Sort numerically, as per the `--numeric-sort' option below, and in
       addition handle IEC or SI suffixes like MiB, MB etc (*note Block
       size::).  Note a mixture of IEC and SI suffixes is not supported
       and will be flagged as an error.  Also the numbers must be
       abbreviated uniformly.  I.E. values with different precisions like
       6000K and 5M will be sorted incorrectly.





Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#5804; Package coreutils. (Thu, 01 Apr 2010 17:33:01 GMT) Full text and rfc822 format available.

Message #34 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Michal Svoboda <pht <at> spatium.org>
To: bug-coreutils <at> gnu.org
Subject: Re: bug#5804: sort --human
Date: Thu, 1 Apr 2010 19:32:18 +0200
Jim Meyering wrote 1206 bytes:
> ;-)
> Perhaps he meant that it works as documented:
> 
>   `-h'
>   `--human-numeric-sort'
>   `--sort=human-numeric'
>        Sort numerically, as per the `--numeric-sort' option below, and in
>        addition handle IEC or SI suffixes like MiB, MB etc (*note Block
>        size::).  Note a mixture of IEC and SI suffixes is not supported
>        and will be flagged as an error.  Also the numbers must be
>        abbreviated uniformly.  I.E. values with different precisions like
>        6000K and 5M will be sorted incorrectly.

I see, I wasn't aware of the "Note". In that case, it is suitably
described as "this will sort whatever the other coreutils give you when
you use -h".

Michal Svoboda 





Severity set to 'wishlist' from 'normal' Request was from Bob Proulx <bob <at> proulx.com> to control <at> debbugs.gnu.org. (Sat, 03 Apr 2010 20:04:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 02 May 2010 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 15 years and 51 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.