GNU bug report logs - #10281
du: hard-links counting with multiple arguments (commit

Previous Next

Package: coreutils;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Mon, 12 Dec 2011 18:02:02 UTC

Severity: wishlist

Tags: wontfix

Merged with 10282, 11526

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Alan Curry <pacman-cu <at> kosh.dhis.org>
Cc: 10281 <at> debbugs.gnu.org, Elliott Forney <elliott.forney <at> gmail.com>
Subject: Re: bug#10281: change in behavior of du with multiple arguments
	(commit
Date: Wed, 14 Dec 2011 17:46:29 -0800
On 12/14/11 13:54, Alan Curry wrote:
> Why not let the -c total be correct *and* the -s individual numbers also be
> correct for the names they are next to?

Well, for starters, because the individual numbers
*are* correct for the names they are next to, for a
reasonable definition of "correct".  If the working
directory has two subdirectories A and B in that order,
it's counterintuitive that "du ." should output different
numbers for B than "du A B" does.  It's more intuitive
if the two invocations of du output numbers that agree.
But the Solaris du semantics require that the
numbers must disagree if A and B share space.

The use case you gave works with two arguments, but
it loses useful information with three or more arguments.
For example, suppose I have a bunch of hard links
that all reside in three directories A, B, and C,
and I want to find out how much disk space
I'll reclaim by removing C.  (This is a common situation
with git clones, for example.)  With GNU du, I can run
"du -s A B C" and the output line labeled "C" will tell
me how much disk space I'll reclaim.  There's no easy way
to do this with Solaris du.

In contrast, GNU du can easily support the use case you
mentioned, even with more than two arguments:

  du -s A
  du -s B
  du -s C
  du -cs A B C | tail -1

so in this sense its semantics are more powerful than
those of Solaris du.




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

Previous Next


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