[nycbug-talk] find exclude question

N.J. Thomas njt
Mon Oct 17 13:34:37 EDT 2005

* Steve Rieger <steve.rieger at tbwachiat.com> [2005-10-17 13:22:28 -0400]:
> i would like to run the following find /path/to/dir -atime +14 -- 
> exclude dir1,dir2 -exec rm -fr {} \ ;
> i want to exclude dir1 and dir2 from this find

You want "-prune", as in:

    find /path/to/dir \( -path /path/to/dir/dir1 -o -path /path/to/dir/dir2\) -prune -o -print

Put all your options on the -print side.


N.J. Thomas
njt at ayvali.org
Etiamsi occiderit me, in ipso sperabo

More information about the talk mailing list