[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: du --files-from feature request
From: |
Pádraig Brady |
Subject: |
Re: du --files-from feature request |
Date: |
Mon, 1 Dec 2008 02:41:09 +0000 |
User-agent: |
Thunderbird 2.0.0.6 (X11/20071008) |
Aaron Peterson wrote:
> Hi,
> A feature request for du, a way to sum from a list of files without
> doing tr \n \0
Supporting --files-from would be less general.
Is `tr '\n' '\0'` that onerous?
> I had to sort some files and and needed to know how large the group of
> files that I had found were.
>
> I spend many hours trying to figure this out / and searching for solution.
> It turns out that the \0 delimited list requirement was very painful.
> I wish I could cat the output of find into du and get the total
find -type f -print0 | du -c --files0-from=- | tail -n1
Having reviewed the docs I noticed that the most common
case of specifying '-' (stdin) to the --files0-from option
is not mentioned. So I just pushed this change to address that:
http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=00b5a2db33cddadf641ae2f01534514314d7e817
I also did a non user visible change to the info docs while I was
at it to standardize on using lower-case @var{file}:
http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=1ce9d86c308d7daa6271a2e87629984b153ee9da
> # wc could not be used to count NUL-separated items
> # (another more complex program would be needed)
tr -d '\n' | tr '\0' ''\n' | wc -l
> $ xargs -n1 -d \\n --arg-file=files.list archive
> # if the list is very long
> # here files0.list could be used
xargs -0 ...
Pádraig.