Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!execu!sequoia!rpp386!jfh From: jfh@rpp386.cactus.org (John F. Haugh II) Newsgroups: comp.unix.internals Subject: Re: How do you find the symbolic links to files. Message-ID: <18742@rpp386.cactus.org> Date: 18 Nov 90 15:30:08 GMT References: <4899@trantor.harris-atd.com> <4900@trantor.harris-atd.com> <1990Nov17.203012.28052@maverick.ksu.ksu.edu> Reply-To: jfh@rpp386.cactus.org (John F. Haugh II) Organization: Lone Star Cafe and BBS Service Lines: 28 X-Clever-Slogan: Recycle or Die. In article <1990Nov17.203012.28052@maverick.ksu.ksu.edu> jwindley@matt.ksu.ksu.edu (Jay Windley) writes: >tcurrey@x102a.ess.harris.com (currey tom 76327) writes: >>> How do you find the # of and locations of all links to a file? >chuck@trantor.harris-atd.com (Chuck Musciano) writes: >> 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? > >SunOS% find /foo -inum -print > >where /foo is the mount point of the filesystem and is the inode >number will display the paths of all hard links to an inode. Lest I be accused of somehow "breaking" find(1), the above command will not work if there are any directories mounted on "/foo" which contain a file with the same i-number. Since "/" is a directory which is frequently mounted on (;-), I think this is a real problem. The -xdev option can be used to keep find on the same file system, but it is not a "standard" option. -- John F. Haugh II UUCP: ...!cs.utexas.edu!rpp386!jfh Ma Bell: (512) 832-8832 Domain: jfh@rpp386.cactus.org "SCCS, the source motel! Programs check in and never check out!" -- Ken Thompson