Heiko Baumann <[EMAIL PROTECTED]> wrote:
> 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 :(
It exists already:
du -s --files0-from=F
>From --help/man output:
--files0-from=F summarize disk usage of the NUL-terminated file
names specified in file F
Note that the files in F have to be \0-separated.
As long as your file.txt doesn't contain any names with
embedded newlines, you can convert it like this:
tr '\n' '\0' < file.txt > file0.txt
then do this:
du -s --files0-from=file0.txt
_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils