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

Re: [Sheflug] listing sizes of directories..



>>>>> "Will" == Will Newton <will [at] misconception.org.uk> writes:

    Will> On Mon, 25 Sep 2000, Stephen J. Turnbull wrote:
    Barrie> How do I list the size of a directory (instead of getting
    Barrie> the fake size of 4k)?

    >> That's not a "fake size".  That is the amount of space occupied
    >> by the directory data.  It gets bigger for sufficiently large
    >> directories (try `ls -ld /dev' for example).

    Will> rwxr-xr-x 1 root root 0 Jan 1 1970 /dev

    Will> Hmmm? :)

If that's really your /dev, things are very very broke on your
system.  Cf my response to Alex.

steve@turnbull:Dynamics$ ls -ld /dev
drwxr-xr-x    3 root     root        15360 Sep 28 07:51 /dev

The difference is an exercise for the reader.  I forgot about this
possibility, my rule is "if it ain't broke, don't broke it more" so I
don't have the latest yet.  (Yeah, I run 2.4.0-test versions, but
that's because 2.2 VM is broke, and 2.4 does seem to give a
performance improvement in my configuration.)

>>>>> "Al" == Alex Hudson <hudson [at] id-pro.co.uk> writes:

    Al> Running 2.4 by any chance?

Why yes, I am.  So?  At Skinny Boy Associates, we install no feature
before its time.

    Al> Looked at /proc? They're not on the filing system, therefore
    Al> have no size ;)) Look at something more relevant, like /usr or
    Al> something. I think Stephen chose a bad example ;))

No, actually I chose a good example, although to prove another point.
It proves that Linus was right, and still is.  It doesn't show up as a
directory and the time stamp is obviously bogus (were either of you
born before the epoch? I doubt your system has been running with
exactly the same /dev since then!)

As you say, cf /proc:

steve@turnbull:Dynamics$ ls -ld /proc 
dr-xr-xr-x   71 root     root            0 Sep  4 21:05 /proc

Note that it is a directory, it has a plausible number of links, and,
ah, the time stamp is only moderately bogus.  Oh well.  I guess on a
modern system it doesn't really make sense to update /proc's time stamp
on every process invocation.

Boy, one starts to wonder if Linux is safe for use ("Kids!  These
stunts are demonstrated by professionals!  Don't try this at home!")
Fsckin' 80%-ers.

/usr is a terrible example, by the way.  /usr/lib or /usr/include,
maybe.

steve@turnbull:Dynamics$ ls -ld /usr /usr/lib /usr/include
drwxr-xr-x   18 root     root         1024 Apr 17 18:43 /usr
drwxr-xr-x   38 root     root         8192 Sep  7 11:23 /usr/include
drwxr-xr-x   60 root     root        11264 Sep  7 11:25 /usr/lib


-- 
University of Tsukuba                Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Institute of Policy and Planning Sciences       Tel/fax: +81 (298) 53-5091
_________________  _________________  _________________  _________________
What are those straight lines for?  "XEmacs rules."
---------------------------------------------------------------------
Sheffield Linux User's Group - http://www.sheflug.co.uk
To unsubscribe from this list send mail to
- <sheflug-request [at] vuw.ac.nz> - with the word 
 "unsubscribe" in the body of the message. 

  GNU the choice of a complete generation.