How do you find the symbolic links to files.

Chuck Musciano chuck at trantor.harris-atd.com
Sun Nov 18 01:39:43 AEST 1990


In article <4899 at trantor.harris-atd.com>, tcurrey at x102a.ess.harris.com (currey tom 76327) writes:
> 
>    How do you find the # of and locations of all links to a file?

     This is an easy one.  You cannot.
     
     Well, sort of.  You cannot determine which hard links to a file exist
without examining all the directories in a given file system, looking for
the specific inode of the file in question.  Does anyone know of a tool to
do this?

     Symbolic links are tougher.  Since sym-links can span file systems and
NFS, you are not guaranteed to ever find all of them, only the ones in files
systems you have access to.  You need to use find to find all symbolic links,
and then examine the link to see if it points to the file in question.  This
can be tough, since some links are quite circuitous and not at all obvious.

     Easiest way: remove the file in question.  Wait for the phone to ring.
     
-- 

Chuck Musciano				ARPA  : chuck at trantor.harris-atd.com
Harris Corporation 			Usenet: ...!uunet!x102a!trantor!chuck
PO Box 37, MS 3A/1912			AT&T  : (407) 727-6131
Melbourne, FL 32902			FAX   : (407) 729-2537

A good newspaper is never good enough,
	but a lousy newspaper is a joy forever.		-- Garrison Keillor



More information about the Comp.unix.wizards mailing list