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: Jim Meyering
Subject: Re: Feature Request: du --include-from=file
Date: Wed, 09 May 2007 14:03:37 +0200

Heiko Baumann <address@hidden> 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




reply via email to

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