Re: how does "du" deal with hard links?

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

 



On Thu, Nov 01, 2007 at 08:47:43AM -0400, Robert P. J. Day wrote:
> $ du -s git*
> 26340   git
> 9672    git.local
> 26292   git.nolinks
> $
> 
> as if du already knows which files it's seen under "git" and won't
> recount them under "git.local" based on hard links.  if that's the
> case,

Yes, du skips files with the same inode.

> then it won't be surprising to see the numbers on the first two
> reversed if i explicitly change the order of the arguments:

Yes, unless their contents are exactly the same.

> $ du -s git.local git git.nolinks
> 26292   git.local
> 9720    git
> 26292   git.nolinks
> $
> 
>   i can see what's happening, i just didn't realize that that's how
> "du" operated.  is that deliberate?
> 

26340+9672 = 26292+9720 = 36012

Files in git.local but not in git:
9672

Files in git but not in git.local:
9720

Files common in git.local:
26292-9672 = 16620

Files common in git:
26340-9720 = 16620

-- 
lfr
0/0

Attachment: pgpfs0yNKDuiB.pgp
Description: PGP signature


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux