find and searching for specific expression in files

Mel Flynn mel.flynn+fbsd.questions at mailing.thruhere.net
Sat May 30 16:12:28 UTC 2009


On Saturday 30 May 2009 17:57:14 Wojciech Puchar wrote:
> >> because it tells you the file in which the text pattern was found :).
> >
> > Discouraged because:
> > - it's possible to hit maxarglen if the root directory has many
> > subdirectories.
>
> xargs is usefull too. i would it as forking for each
> file will make processing really slow. xargs can cut input data into given
> chunks with -n option, so grep will be called for say 100 files at once.

Cut off the message a bit later and you will see that using a '+' to terminate 
the exec primitive emulates xargs behavior:

On Saturday 30 May 2009 14:12:50 Mel Flynn wrote:
> I use + rather then ; so that one
>invocation for grep is done whenever maxarglen is hit (like if you used
>xargs(1)), rather then one grep per file.

-- 
Mel


More information about the freebsd-questions mailing list