bug-coreutils
[Top][All Lists]
Advanced

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

Re: Bug#563118: du cannot sort its output without help from other progra


From: Eric Blake
Subject: Re: Bug#563118: du cannot sort its output without help from other programs
Date: Thu, 31 Dec 2009 05:48:55 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Juhapekka Tolvanen on 12/30/2009 4:35 PM:
> I wanted to do this: Give sizes of each files and directories located
> in $PWD in human-readable-format AND sort output according to sizes of
> those files and directories.

What's wrong with:

du -sh0 * | sort -hz | tr '\0' '\n'

besides needing coreutils 7.5 or newer?

> But it would be much easier, if du had some sorting functionalities.

Rather, it IS much easier by using du's nul-termination functionality,
coupled with sort's nul-termination and human-size sorting.  Use each tool
for what it is good at.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAks8nbcACgkQ84KuGfSFAYDlgACgw0pEnqORZyCR51Lnk13bCrGm
VxEAn2eK5wZ/etcchnghx6OqCgH98UWt
=w2Bj
-----END PGP SIGNATURE-----




reply via email to

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