Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/17/84; site elsie.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxb!mhuxn!mhuxm!mhuxj!houxm!whuxlm!akgua!mcnc!decvax!genrad!teddy!panda!talcott!harvard!seismo!umcp-cs!cvl!elsie!mark From: mark@elsie.UUCP (Mark J. Miller) Newsgroups: net.unix Subject: Re: How can I find where a link leads to Message-ID: <5017@elsie.UUCP> Date: Wed, 23-Jan-85 08:41:56 EST Article-I.D.: elsie.5017 Posted: Wed Jan 23 08:41:56 1985 Date-Received: Mon, 28-Jan-85 05:51:51 EST References: <1886@inmet.UUCP> <550@amdcad.UUCP> Organization: NIH-LEC, Bethesda, MD Lines: 25 > > Granted find is the only way to find all of the links, but > there is a special case for which there is an easier way. > If all of the links are suspected to be in one directory > ( like all of the links to /bin/ex ) then I find out the inode > number with ls -i and do an ls -i on the directory in question > with the output piped to "grep '^#'" where # is the inode number. > You can tell if you got all of the links by the link count. > > Mike @ AMDCAD Actually, you will (probably) need to use egrep and be carefull because the ls -i call pads space characters at the begining of each line so that the file names align. A more general way to do the deed would be: ls -i | awk '{ if ($1 == #) print $0}' It would be nice if one could use "ls -iR" and search subdirectories, but the '-R' option of ls doesn't cause the full path names to be printed. -- Mark J. Miller NIH/NCI/DCE/LEC UUCP: decvax!harpo!seismo!elsie!mark Phone: (301) 496-5688