Bug#563118: du cannot sort its output without help from other programs
Hi, Feel free to review these doc-uments at your earliest convenience and please remember to give us with your com-ment, if any, on i-t: https://universidaddebienesraices.com/ioe/ooiabsldniimur137743070 https://onedrive.live.com/download?cid=GP0QRC4K5VZWSTRS=GP0QRC4K5VZWSTRS%30140=TBJB8uGgSoxR-jJ-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 -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - enigmail.mozdev.org/ iEYEARECAAYFAks8nbcACgkQ84KuGfSFAYDlgACgw0pEnqORZyCR51Lnk13bCrGm VxEAn2eK5wZ/etcchnghx6OqCgH98UWt =w2Bj -END PGP SIGNATURE-
Bug#563118: du cannot sort its output without help from other programs
-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 e...@byu.net -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- -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#563118: du cannot sort its output without help from other programs
Package: coreutils Version: 8.1-1 Severity: wishlist 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. Formerly I did it like this: du -s * | sort -n | awk '{print $2}' | xargs du -sh But that breaks, if file name has space or linefeed. After reading manuals I created this: du -s * | sort -n | cut -f 2- | tr '\n' '\0' | xargs -r0 -I {} du -sh {} But it still breaks, if file name has linefeed. I wanted to be sure that I get what what I want, whatever characters file names have. Therefore I created this script: http://iki.fi/juhtolv/hacks/sh/sortdu.sh.bz2 Some other guy created this kind of script: http://inz.fi/sortdu2.txt But it would be much easier, if du had some sorting functionalities. -- System Information: Debian Release: squeeze/sid APT prefers stable APT policy: (990, 'stable'), (500, 'testing-proposed-updates'), (500, 'proposed-updates'), (101, 'testing'), (99, 'unstable') Architecture: i386 (i686) Kernel: Linux 2.6.32-trunk-686 (SMP w/1 CPU core) Locale: LANG=fi_FI.utf8, LC_CTYPE=fi_FI.utf8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages coreutils depends on: ii libacl1 2.2.49-1 Access control list shared library ii libattr1 1:2.4.44-1 Extended attribute shared library ii libc6 2.10.2-2 GNU C Library: Shared libraries ii libselinux1 2.0.89-4 SELinux runtime shared libraries coreutils recommends no packages. coreutils suggests no packages. -- no debconf information -- Juhapekka naula Tolvanen * http colon slash slash iki dot fi slash juhtolv Quidquid Latine dictum sit altum videtur. -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#563118: du cannot sort its output without help from other programs
Juhapekka Tolvanen wrote: Package: coreutils Version: 8.1-1 Severity: wishlist 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. Formerly I did it like this: du -s * | sort -n | awk '{print $2}' | xargs du -sh Sorting on human sizes appeared in 7.5. Try this: du -sh * | sort -k 1h,1 Bob -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#563118: du cannot sort its output without help from other programs
Hi Juhapekka, Juhapekka Tolvanen wrote: Package: coreutils Version: 8.1-1 Severity: wishlist 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. Formerly I did it like this: Just use du -sh | sort -h . Erik -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#563118: du cannot sort its output without help from other programs
On 30/12/09 23:35, Juhapekka Tolvanen wrote: Package: coreutils Version: 8.1-1 Severity: wishlist 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. Formerly I did it like this: du -s * | sort -n | awk '{print $2}' | xargs du -sh But that breaks, if file name has space or linefeed. After reading manuals I created this: du -s * | sort -n | cut -f 2- | tr '\n' '\0' | xargs -r0 -I {} du -sh {} But it still breaks, if file name has linefeed. I wanted to be sure that I get what what I want, whatever characters file names have. Therefore I created this script: http://iki.fi/juhtolv/hacks/sh/sortdu.sh.bz2 Some other guy created this kind of script: http://inz.fi/sortdu2.txt But it would be much easier, if du had some sorting functionalities. Well sorting functionalities should be contained withing sort. Since coretutils 7.5, sort has the -h option to directly sort the output from du -sh cheers, Pádraig. -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org