Re: Finding the size of directory with multiply hardlinked files

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

 



Dean S. Messing wrote:
Thanks Roberto.  That's _exactly_ what I want.

I saw the -c option of `du' in the man page when
trying to figure this out but it just says

       -c, --total
              produce a grand total

Pray tell, how did you figure this out.
I've re-read the man page and I don't see this
this differential behaviour advertised anywhere.

I just got it by testing and observing results.

Actually, the "-c" is not needed at all, it's there
because I also want to know the total space used by backups.

And... the "-s" is also not needed! It just avoids the
printing of all the subtotals of the subdirectories of
your backups.

It looks like du simply discard everything already
found on its way when calculating disk space.

Look at this:

$ mkdir d
$ head -c 1000000 /dev/zero >f1
$ ln d/f1 d/f2
$ cp d/f1 d/f3

Now, this command reports only two files and not the third (hardlinked):

$ du d
1962    d

And, look at this; f2 is totally ignored even if it appears on the
command line:

$ du d/f1 d/f2 d/f3
981     d/f1
981     d/f3

Amazing.

--
   Roberto Ragusa    mail at robertoragusa.it

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux