Finding links

Guy Harris guy at auspex.auspex.com
Thu Oct 26 04:00:23 AEST 1989


>[-prune is documented but not yet implemented for SunOS4.0.3].

Excuse me?  It has worked just fine since at least SunOS 3.0, and
possibly as far back as 2.0....

As the manual page indicates, it prunes the tree as soon as it is
executed, which means if you want to conditionally prune a tree, you
need some predicate to control when it will be executed; since there's
no "have I crossed a file system boundary" predicate, there's no way to
get the effect of "-xdev" with "-prune", but you *can*, for instance,
limit a "find" to locally-mounted file systems:

   find / -name .nfs\* -mtime +7 -exec rm -f {} \; -o -fstype nfs -prune

from the 4.0 "crontab".  (This may want to be modified in future
releases, since SunOS 4.1 will probably also support RFS, and S5R4 will
support NFS, RFS, "/proc", and a bunch of other file system types that
shouldn't be searched, and at least two types that should, namely S5 and
4.2BSD.)



More information about the Comp.unix.questions mailing list