|
From: | Richard Ems |
Subject: | Re: du reports different results for "." |
Date: | Thu, 21 Feb 2008 11:11:05 +0100 |
User-agent: | Thunderbird 2.0.0.9 (X11/20071114) |
James Youngman wrote:
On Feb 20, 2008 6:58 PM, Richard Ems <address@hidden> wrote:Hi list! If I do a "du -s * ." and right afterwards "du -s ." I get different values for the actual directory ".". This is on Linux, openSUSE 10.3, coreutils-6.9-43, xfs filesystem. Example: # du -s * . | grep "\.$" ; du -s . 23227004 . 25251176 . Is this correct "du" behavior ?It's hard to say, because you haven't given us enough information to form an opinion. Hang on a minute while I log into your system and take a look.... see what I mean?
I thought that operating system, coreutils version and filesystem could be enough for a start.
Two things that spring to mind are the possibility that the * is expanding into a bunch of file names, some of which may begin with "-" and thus modify the behaviour of du. ("du -s ./*" is much, much, safer than "du -s *).
Sure, "*" IS expanding into many file names, but none of them begin with "-". And, if you check the "grep" command on my example, what I was comparing was the different values given for ".", not for "*". Apparently I was not clear enough.
Is there activity in the directories beneath "."? That will change the answer du gives, of course. Try comparing the result of something like "set -x; du -s . . ; du -s . ; sleep 60; du -s .".
Of course there is no activity beneath "." !And the difference also appears when doing a "du -sh . .", but this behavior seems now to be cleared, as Paul Eggert and Bob Proulx commented, I have many hard links under this directories, and these causes the difference.
Richard -- Richard Ems mail: address@hidden Cape Horn Engineering S.L. C/ Dr. J.J. Dómine 1, 5º piso 46011 Valencia Tel : +34 96 3242923 / Fax 924
[Prev in Thread] | Current Thread | [Next in Thread] |