[net.unix] How can I find where a link leads to ???

mr@hou2h.UUCP (M.RINDSBERG) (01/09/85)

How can I find where a link leads to ???

							Mark

Doug Gwyn (VLD/VMB) <gwyn@Brl-Vld.ARPA> (01/11/85)

ls -i filename
gives you the inode number; otherwise the question has no meaning.
All links have the same status; there is no place in the
hierarchical file system where the file "really" is.

roy@phri.UUCP (Roy Smith) (01/14/85)

> ls -i filename
> gives you the inode number; otherwise the question has no meaning.
> All links have the same status; there is no place in the
> hierarchical file system where the file "really" is.

The above was posted as an answer to the question "how can I find out where
a link leads to?".  While the answer is technically correct, give the guy
who asked the question a break, huh?  Assuming the original question should
really have been "how can I find all the other directory entries which point
to the same inode as file X?", you can take the inode number given to you by
"ls -i" and find out ALL the files that have that inode number by doing
"ncheck -i ZZZ /dev/rra0h", assuming that ZZZ is the inode number and your
file system is mounted on /dev/ra0h (the extra 'r' in 'rra0h' says use
the raw device -- it's a bit faster, that's all).  Note, you probably won't
be able to run ncheck unless you are the super-user.  Hope that helps.
-- 
Don't blame me, I just work here....

{allegra,seismo,ihnp4}!vax135!timeinc\
                 cmcl2!rocky2!cubsvax >!phri!roy  (Roy Smith)
                      philabs!cubsvax/

mike@enmasse.UUCP (Mike Schloss) (01/19/85)

> How can I find where a link leads to ???
> 
> 							Mark

First do a ls -i to determine the inode #.
Then either run find <dir> -inum # where dir is the mount point of the
file system OR run ncheck /dev/dsk/XYZZY -i # where XYZZY is the section
that has the mounted file system.

Note: find may return files with the same inum in other filesystems if
they are mounted somewhere underneath <dir>