[nycbug-talk] find exclude question

George Georgalis george
Mon Oct 17 18:16:41 EDT 2005


On Mon, Oct 17, 2005 at 03:19:24PM -0400, N.J. Thomas wrote:
>* George Georgalis <george at galis.org> [2005-10-17 14:01:29 -0400]:

>> >    find /path/to/dir \( -path /path/to/dir/dir1 -o -path /path/to/dir/dir2\) -prune -o -print
>> 
>> Isn't that the oppisit of requested? eg prune returns the trimmings

Forgot to mention, I missed the "-prune -o" part so it's not, as I
thought, oppisit ... %-) guess you need the -print if -o is prior.

another way is 

find . ! \( -path ./dir/dir2 -prune -o -path ./dir/dir1 -prune \)

but you still got to watch out for the hit on ./dir

// George


-- 
George Georgalis, systems architect, administrator <IXOYE><
http://galis.org/ cell:646-331-2027 mailto:george at galis.org




More information about the talk mailing list