bug-coreutils
[Top][All Lists]
Advanced

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

Re: Feature Request: du --include-from=file


From: Eric Blake
Subject: Re: Feature Request: du --include-from=file
Date: Wed, 09 May 2007 06:06:57 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.10) Gecko/20070221 Thunderbird/1.5.0.10 Mnenhy/0.7.5.666

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

According to Heiko Baumann on 5/9/2007 1:40 AM:
> Hi,
> 
> it would be nice to have a --include-from=file option for du(1).
> 
> i have a plain text file with a lot of path names (verbose output from tar) 
> in it and want to get the size for this files.
> 
> myhost:~ # du -sch `cat file.txt`
> -bash: /usr/bin/du: Argument list too long
> myhost:~ #
> 
> does not work.
> 
> i tried xargs(1) but this breaks -s functionality :(

Thanks for the report.  However, du already has --files0-from=file, which
solves your problem in a more secure manner (it handles arbitrary file
names correctly, where your request would not).  Assuming that file.txt
did not include any files with a newline in the name, you can do:

# tr '\n' '\0' < file.txt > file0.txt
# du -sch --files0-from=file0.txt

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

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

iD8DBQFGQblh84KuGfSFAYARAnDJAJ97/5Uwqn4roaPVayW2KsgJZHdt3QCghlw/
ciNnMNoIhi6tv8uspQjq3LQ=
=HuHx
-----END PGP SIGNATURE-----




reply via email to

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