GNU bug report logs - #35488
Feature du --files-only request

Previous Next

Package: coreutils;

Reported by: David Ellenberger <davidmarioellenberger <at> gmail.com>

Date: Mon, 29 Apr 2019 15:06:02 UTC

Severity: wishlist

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: David Ellenberger <davidmarioellenberger <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: Feature du --files-only request
Date: Mon, 29 Apr 2019 13:36:31 +0200
[Message part 1 (text/plain, inline)]
Dear maintainers

As you're probably aware, du --apparent-size calculates/reports 1 file
system block for a [empty] folder (typically 4096 bytes). I find that a bit
inconsistent with what the option suggests. The manual entry to
--apparent-size doesn't help the understanding.

From a practical point of view, when we admins copy a folder&files
structure from one to another file system where block size doesn't
correspond, we cannot use du to get a count comparison and have to resort
to something like:
$ ls -anR | grep -v '^d' | awk '{total += $5} END {print total, "Bytes"}'

Windows explorer shows zero bytes for an empty folder or folder containing
multiple empty folders. This way, comparing two copied folders&files's
content by size works out well regardless of file system and its block
sizes it uses.

I understand that admins have become accustomed to see 4096 in directories
as it's consistent with the ls command and the technicality behind it.

In my daily admin tasks I never had to count sizes of empty folders. The
overhead of provisioning and enable the file system to work is something we
typically accept and do not require to re-calculate nor even to understand
in all details. Anyway, the FS provisioning and logical blocks perspective
is a complete different things for which we have the df command and other
tools.

I'd therefore suggest a new option --files-only (which calculates only the
size of files and skips over anything else that has a directory attribute
flag, device, symbolic link etc..).

Like that we would finally be able to count file sizes consistently align
with the du manual entry which says 'DESCRIPTION: Summarize disk usage of
each FILE, recursively for directories.'

Thanks for reading,

David
[Message part 2 (text/html, inline)]

This bug report was last modified 6 years and 54 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.