bph@buengc.BU.EDU (Blair P. Houghton) (10/20/89)
In article <598@cogent.UUCP> doug@cogent.UUCP (Doug Perlich) writes: >I ocasionally have problems working in large project groups when someone >has a link (using ln) to a file. I can't find the file that the link(s) are >to. (Different name, different directory). Same inode. 1. Get the inode number of the file you know about: ls -i filename.here which emits something like "5887 filename.here" where 5887 is an example inum. 2. cd to the smallest directory (why start at / if you don't have to?) that you are sure includes the mystery filename, then find . -inum 5887 -print and you should see all the filenames that link to that file. If the link was symbolic rather than hard (i.e., made with "ln -s file name" rather than "ln file name", which must be the case if the link crosses a partition boundary, but is not restricted to such cases) then it will have a different inum. You can, however, do this: 0. cd to the smallest, etc., etc. find . -type l -exec ls -l \{\} \; | grep filename.here and the name will pop out as in -rw-r--r-- 2 mrx 1 Oct 19 18:51 ./pathfoo/foo2 -> /pathhere/filename.here and you can go ask mrx what he's doing linking foo2 to filename.here... --Blair "I'm sure everyone else has a fave method. Let's slog through them all, shall we? :-)"