Should find traverse symbolic links?

Bob Peirce #305 rbp at investor.pgh.pa.us
Sat Mar 9 01:29:32 AEST 1991


In article <1991Feb25.143543.4213 at mp.cs.niu.edu> rickert at mp.cs.niu.edu (Neil Rickert) writes:
>In article <1991Feb25.130613.2553 at phri.nyu.edu> roy at alanine.phri.nyu.edu (Roy Smith) writes:
>>	I was surprised to observe today that if you do "find dir ..." and
>>dir is a symbolic link to a directory, the directory isn't entered.  Thus:
>>
> Now just imagine I run a script overnight to remove stale core files.
> Naturally I use something like:
>
>       find . -atime +7 -name core -exec rm \{\} \;
>
> But, unbeknowns to me, some user has done the following:
>
>	ln -s / root
>
> If find followed symbolic links, how long do you think it would take this
>script to complete its execution?

About seven hours.  At least that's what I recently discovered on my
Altos 3068.  Altos' find does traverse symbolic links, which are
implemented under SysV and, therefore, may be strange.  Altos also
has worknet, where the top level directory is @ and this is linked to
/AT by ln -s @ /AT.  Therefore, when cron says

	find / -type p -print > /FIFOs

as it does each night because tar doesn't back them up, you get into an
endless loop which eventually dies for no apparent reason.  Maybe it
uses all the space on the root partition.  That would stop it.
-- 
Bob Peirce, Pittsburgh, PA				  412-471-5320
...!uunet!pitt!investor!rbp			rbp at investor.pgh.pa.us



More information about the Comp.unix.wizards mailing list