[ale] find or locate text

Fletch fletch at phydeaux.org
Wed Oct 9 12:17:36 EDT 2002

>>>>> "Chris" == Chris Coleman <chriscoleman at mail.clayton.edu> writes:

    Chris> find / -name \* -exec grep string {} \; 

        That'll start up a grep for each file.  More efficient to use
xargs instead which will break the arguments up into batches.  That
find invocation will also look at things such as directories and
device files as well as plain vanilla files; better to limit with
`-type f' rather than `-name \*'.

find . -type f -print0 | xargs --null grep fooble

        Or for the zsh users in the audience you can dispense with the
find (presuming there's not too many filenames . . .

grep fooble **/*(.)

        If that complains about `argument list too long' use xargs 

print -N **/*(.) | xargs --null grep fooble

Fletch                | "If you find my answers frightening,       __`'/|
fletch at phydeaux.org   |  Vincent, you should cease askin'          \ o.O'
770 294-0820 (m)      |  scary questions." -- Jules                =(___)=
                      |                                               U

This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.

More information about the Ale mailing list