× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Rob Berendt wrote:
> Things to be careful of are symbolic links, etc.  There are a lot of
> these.  You want to ensure that you are reporting the space of the
> symbolic link and not the object it references.

Vern Hamberg wrote:
One of the Unix dweebs will need to explain more here, I think. 'du' has some other switches that have to do with multiple links to an object, according to the AIX docs. I did not look too carefully for details.

One thing I like is getting the full path for each object. And the size is actual disk allocated space, I believe, instead of bytes.

The symbolic link thing is tricky when walking the IFS tree - different functions to get resolved info vs. just link info (lstat vs. stat, right?). And one of the APIs lets you filter out symbolic links - nice.

du does not be default dereference links (symbolic or hard). There are arguments to du that can change that behavior. From the du man page:


       -l, --count-links
              Count  the  size  of  all  files, even if they have
              appeared already (as a hard link).

       -L, --dereference
              Dereference symbolic links  (show  the  disk  space
              used  by the file or directory that the link points
              to instead of the space used by the link).

It's still not very efficient, IMO - takes a long time to get through a big system. Can you imagine a SAN, with 22 teras?

du does not run very fast since it goes through the current directory and all subdirectories counting up file sizes. But the results are accurate. It would take a long time to do "cd / ; du" on something with 22 terabytes of used storage. For a summary of total disk used without caring about how it is used the 'df' command is very handy. But unfortunately not available to AS/400 users.


James Rich


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.