On 06/06/2013 10:00 PM, C de-Avillez wrote: > Hello, > > This comes from https://launchpad.net/bugs/1187044. The OP (although > completely confused initially) raises a point that I sort of agree. The man > page for 'du' states, for --separate-dirs, "do not include size of > subdirectories"; but it is not really clear what that means -- a first read I > had got me also a bit confused. > > On the other hand, I am having problems trying to convey something more > "clear". > > separate directory size from directory contents > output size of directory separate from size of directory contents
Well that's a bit ambiguous too since non directory entries are included with --separate-dirs. > > I think something like this could be used, but I would like some input before > going on. I see the original confusion in the man page, also the texinfo was a bit confusing to me. So hopefully the attached clarifies both appropriately. thanks, Pádraig.
>From 245206d430a9b06eebf9bd3d55cff7a341bdeee7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= <[email protected]> Date: Wed, 12 Jun 2013 11:40:25 +0100 Subject: [PATCH] doc: clarify the description of du --separate-dirs * src/du.c (usage): Clarify that --separate-dirs doesn't exclude all directories. * doc/coreutils.texi (du invocation): Avoid implying that -S excludes the size of any non directory entries for a directory. Also don't mention st_size as it's dependent on --apparent-size. Reported by C de-Avillez in <https://launchpad.net/bugs/1187044> --- doc/coreutils.texi | 3 +-- src/du.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/coreutils.texi b/doc/coreutils.texi index d607eaf..a325bd0 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -11436,8 +11436,7 @@ Normally, in the output of @command{du} (when not using @option{--summarize}), the size listed next to a directory name, @var{d}, represents the sum of sizes of all entries beneath @var{d} as well as the size of @var{d} itself. With @option{--separate-dirs}, the size reported for a directory name, -@var{d}, is merely the @code{stat.st_size}-derived size of the directory -entry, @var{d}. +@var{d}, will exclude the size of any subdirectories. @optSi diff --git a/src/du.c b/src/du.c index a80a177..1aa5a16 100644 --- a/src/du.c +++ b/src/du.c @@ -315,7 +315,7 @@ Summarize disk usage of each FILE, recursively for directories.\n\ "), stdout); fputs (_("\ -P, --no-dereference don't follow any symbolic links (this is the default)\n\ - -S, --separate-dirs do not include size of subdirectories\n\ + -S, --separate-dirs for directories do not include size of subdirectories\n\ --si like -h, but use powers of 1000 not 1024\n\ -s, --summarize display only a total for each argument\n\ "), stdout); -- 1.7.7.6
