Finding links

Clarence Dold dold at mitisft.Convergent.COM
Fri Oct 20 09:22:40 AEST 1989


in article <598 at cogent.UUCP>, doug at cogent.UUCP (Doug Perlich) says:

> 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).

This shell script isn't smart enough to limit its output to the 
current filesystem, but it's cheap.

if [ $# = 1 ]
then
	TARGET=`/bin/ls -i $1|/usr/bin/cut -c1-5`
	if  [ $TARGET  ]
	then
		/bin/find / -inum $TARGET -print 2>/dev/null
	fi
else
	/bin/echo usage: $0 filenm
	exit 1
fi

-- 
---
Clarence A Dold - dold at tsmiti.Convergent.COM		(408) 434-5293
		...pyramid!ctnews!tsmiti!dold
		P.O.Box 6685, San Jose, CA 95150-6685	MS#10-007



More information about the Comp.unix.questions mailing list