Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!uflorida!mlb.semi.harris.com!trantor.harris-atd.com!trantor!chuck From: chuck@trantor.harris-atd.com (Chuck Musciano) Newsgroups: comp.unix.wizards Subject: Re: How do you find the symbolic links to files. Message-ID: <4900@trantor.harris-atd.com> Date: 17 Nov 90 14:39:43 GMT References: <4899@trantor.harris-atd.com> Sender: news@trantor.harris-atd.com Reply-To: chuck@trantor.harris-atd.com (Chuck Musciano) Organization: Advanced Technology Dept, Harris Corp, Melbourne, FL Lines: 28 In article <4899@trantor.harris-atd.com>, tcurrey@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@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