<Summary> Question about backtracking hard links

From: Chris Ruhnke (ruhnke@us.ibm.com)
Date: Tue Feb 13 2007 - 11:14:01 EST


Okay,

I told you it was a newbie type question...

> Gurus,
>
> This seems like a newbie type question, but I have managed to one-track
my
> train of thought and I can't get it back on the mainline...
>
> Given the ls -ldi listing:
>
> # ls -ldi /usr/j2se
> 313862 drwxr-xr-x 7 root bin 512 Oct 18 2001
> /usr/j2se
>
> This says to me that there are 7 hard links to this directory.
>
> However, running find against the inode number yields only ONE hit...???
>
> # find / -inum 313862 -ls
> 313862 1 drwxr-xr-x 7 root bin 512 Oct 18 2001

> /usr/j2se
> #
>
> Where am I going wrong???

Thanks to Casper Dik, Thomas Carter, Rich Kulawiec, Dan Lorenzi, and
numersous others I'm sure are in the process of educating me 8>)) !

A directory file gets links from "." file in the directory itself and all
the ".." files in its subdirectories.
Thus a directory with no subdirectories will always have 2 links.
Add one link for every sudirectory within the directory.
"7" links means I have 5 sudirectories under j2se.

CHRis
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:41:37 EDT