bug-coreutils
[Top][All Lists]
Advanced

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

bug#61884: add an option to du that allows to control which file types a


From: Christoph Anton Mitterer
Subject: bug#61884: add an option to du that allows to control which file types are counted
Date: Wed, 01 Mar 2023 04:18:34 +0100
User-agent: Evolution 3.46.4-1

Hey.

When I want to count the nominal sizes of the (usually regular) files
in a directory I do something like:

du --apparent-size --block-size=1

This however also counts in the sizes of the directories themselves
(and I guess also of symlinks, etc.).


The "problem" with that is in particular, that for the exact same
dir/file structure, the results differ e.g. between ext4 and btrfs,
because of different sizes for the directories (themselves).

It would be nice if there was a option that allowed to select which
file types are counted.


Yes I know that one can do something like:
find . -type f -print0  |  du --apparent-size -l -c -s --block-size=1 
--files0-from=- | tail -n

But that's rather cumbersome... also I cannot do something like
du path1 path2 path3
and get totals for each and a grand summary.

And even if I make an shell alias out of this, I cannot do bash completion on 
it.


Thanks,
Chris.





reply via email to

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