[Courses][Linux comands] tee, file, stat, find

Puja Gupta pugupta at cs.sunysb.edu
Wed Mar 10 15:47:39 EST 2004


Exactly.  You can try to create a new directory and check the "Links" 
value for an empty directory.  Then, try to create file, directory in 
the new directory.  You should see the difference as Laurel says.

find is a little smarter.  It uses "Links" to find out the number of 
subdirectories it needs to traverse from the current parent directory, 
and thus avoid infinite recursion.

Puja.

Laurel Fan wrote:

> On Wed, Mar 10, 2004 at 01:33:53PM -0500, Katie Bechtold wrote:
> 
>>What's going on there?  There are three links to the directory Mail,
>>but "find" only finds one.
> 
> 
> stat includes . (every directory contains a link to itself) and
> .. (every directory contains a link to its parent directory).  So the
> three links that stat finds are:
> 
> Mail
> Mail/.
> Mail/<some-subdirectory-of-mail>/..
> 
> ls ignores . and .. (as well as all other files or directories
> starting with .) unless you give it the -a option.  find may do
> something similar (or just ignore . and .. to avoid infinite
> recursion).
> 
> 



More information about the Courses mailing list