bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: excluding/including directories in grep search path


From: Bob Proulx
Subject: Re: excluding/including directories in grep search path
Date: Thu, 3 Dec 2009 15:11:01 -0700
User-agent: Mutt/1.5.18 (2008-05-17)

Daliyot, Maoz wrote:
> How can I exclude/include directories in grep's search list?

The Unix philosophy would be to use programs that do one thing well.
In this case 'find' is IMNHO the better model.  The 'find' command is
specifically designed to traverse directory hierarchies in whatever
way that you want and to interface to other utilities easily.

  find . -name FOODIR -prune -o -type f -exec grep PATTERN {} +

Bob




reply via email to

[Prev in Thread] Current Thread [Next in Thread]