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

Re: Hard links



On Wed, 24 May 2000, Sven Burgener wrote:

>  108545 drwxr-xr-x  21 root     root         1024 Feb 19 17:34 usr
> 
> and now I issue:
> 
> hp90:/root # find / -inum 108545
> /usr
> 
> All I got is /usr! How can that be explained? I must be missing

Well, the inode for /usr is 108545, so when you search for that inode you
get /usr.  What's wrong with this?

Directories have their own inodes too, which are totally unrelated to the
inodes of any files that might be in that directory.  Therefore, if you
search for the inode of a directory, you should get only that directory.
Any object in a filesystem has an inode, including named pipes, symbolic
links, device files...

Also keep in mind that inodes are not unique on the system, as a file can
have the same inode number as an unrelated file on different filesystems.
Because of this when you use -inum you should probably use -xdev as well.



Reply to: