Subject: Re: bug#10281: change in behavior of du with multiple arguments (commit

From: "Alan Curry" <[email-masked]>
Date: Fri, 16 Dec 2011 21:36:41 -0500 (GMT+5)

Paul Eggert writes:
> 
> 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.

The straightforward method would be to simply the directory you intend to
remove and keep track of the discrepancy between st_nlink and how many links
you've seen.

I admit that this straightforward method isn't implemented in any standard
tool, but your way involves extra work by both du, which must traverse all
the other directories which might share files with the target directory; and
the user, who must somehow amass that list of directories ahead of time. As a
creative improvised use of pre-existing tools it's a good example, but as a
justification for an intentional feature, it's just too inefficient.

-- 
Alan Curry