Finding links

Robert A. Earl rae98 at wash08.uucp
Fri Oct 20 00:51:10 AEST 1989


In article <598 at cogent.UUCP> doug at 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).
>I want to type "findthelinktothefile foobar"
>and it will respond "/path1/path2/.../abc/foobee" and any other names
>linked to the file.
>Thanks -Doug

My SVR2 system has a utility called 'ncheck':
ncheck - generate names from i-numbers
SYNOPSIS
/etc/ncheck [ -i numbers ]  [ -a ] [ -s ]  [ file-system ]

So you would use 'ls -li file_name'
to get the inode number of the file, then use
'/etc/ncheck -i inum_of_file_name /dev/dsk/cur_file_system'
to get a complete listing of the files in the current file
system which share the inode (ie are linked together).

This don't work for symbolic links, of course.
-- 
===========================================================
Name:	Bob Earl		Phone:	(202) 872-6018 (wk)
UUCP:	...!uunet!wash08!rae98	BITNET:	rae98 at CAS



More information about the Comp.unix.questions mailing list