| Author |
Looking for a "sophisticated" find script
|
|
| Generic Usenet Account 2005-07-25, 6:07 pm |
| I want to launch a "find" query, and I want to exclude some directories
from the search. I am looking for something like this:
find . -type f & excludes specified directories -exec do-something {}
\;
or
find . -type f -exec excluding specified directories do-something {} \;
Thanks,
Gus
| |
| rolandberry@hotmail.com 2005-07-25, 6:07 pm |
|
Generic Usenet Account wrote:
> I want to launch a "find" query, and I want to exclude some directories
> from the search. I am looking for something like this:
>
> find . -type f & excludes specified directories -exec do-something {}
> \;
>
> or
>
> find . -type f -exec excluding specified directories do-something {} \;
>
>
> Thanks,
> Gus
pipe the output through grep -v to get rid of the stuff you don't want
| |
| Rakesh Sharma 2005-07-25, 6:07 pm |
|
Generic Usenet Account wrote:
> I want to launch a "find" query, and I want to exclude some directories
> from the search. I am looking for something like this:
>
> find . -type f & excludes specified directories -exec do-something {}
> \;
>
> or
>
> find . -type f -exec excluding specified directories do-something {} \;
>
/bin/find . \
\( -type d \( -name xcludir1 -o -name xcludir2 \) -prune \) \
-o \
-exec Do_Something {} \;
| |
| Bill Marcum 2005-07-25, 6:07 pm |
| ["Followup-To:" header set to comp.unix.shell.]
On 25 Jul 2005 08:39:15 -0700, Generic Usenet Account
<usenet@sta.samsung.com> wrote:
> I want to launch a "find" query, and I want to exclude some directories
> from the search. I am looking for something like this:
>
> find . -type f & excludes specified directories -exec do-something {}
> \;
>
Look at the "-prune" option.
find . -name excluded_dir -prune -o -type f -exec do_something {} \;
-- Tonight you will pay the wages of sin; Don't forget to leave a tip.
|
|
|
|