Re: need help with find command

From: Yamaska (mdk_at__REMOVE_THIS_yamaska.net)
Date: 10/08/04


Date: Fri, 08 Oct 2004 08:21:29 +0200

Eric wrote:
> I want to:
>
> find /home -iname "*.html" -exec grep form {} \; -print
>
> but exclude "/home/Documents" and exclude "/home/.*" directories
>
> I think i need to use -prune but i cant get a handle on how to use it.
> Thanks
> Eric
>
>
Try this example:

find /home -path '/home/Documents' -prune -o -name '*.html'

Just to get you started.
Haven't figured out the double filter yet.
-path works in combination with -prune and -o

-path = chosen path
-prune = prune the chosen path
-o = or send output

So in effect you are saying prune the chosen path or send result to output.

Hope this helps.

Pete