Limits of grep?

Jerry Feldman gaf at blu.org
Tue Sep 26 07:15:49 EDT 2000


That has nothing to do with grep. It is a limit of the shell. One way 
around this is to use the find command:
Remember that find recursively follows directories, so you may want to tell 
find not to recurse.
Simple example:
tarnhelm.blu.org [11] find . -type f -exec grep "Subba Rao" {} \; -print
Subba Rao <subb3 at attglobal.net>
./discuss
or 
tarnhelm.blu.org [12] find . -type f -exec grep -l "Subba Rao" {} \;    
./discuss


Example will search all regular files in the current directory and 
subdirectories. Grep will print the text, but not fhe file name, and if the 
text is found, the file name is printed on the following line. The second 
example uses the -l option of grep which prints only the file name.

Subba Rao wrote:

> I have a directory of 10000+ text files and would like to search for
> some strings in these files. When I tried using "grep" command with an
> asterisk, I get the error message somthing to the effect,
> 
> 	"File argument list too long"
> 
> What is the file argument limit for grep? I guess you need the grep source
> for this. I did not find any information in the man page.
> 
> Are there any other recommended tools to search through such large list of
> files?
> 
> Thank you in advance.
> 
> Subba Rao
> subb3 at attglobal.net
> http://pws.prserv.net/truemax/
> -
> Subcription/unsubscription/info requests: send e-mail with
> "subscribe", "unsubscribe", or "info" on the first line of the
> message body to discuss-request at blu.org (Subject line is ignored).
> 

-- 
Jerry Feldman <gaf at blu.org>
Boston Linux and Unix user group
http://www.blu.org


-
Subcription/unsubscription/info requests: send e-mail with
"subscribe", "unsubscribe", or "info" on the first line of the
message body to discuss-request at blu.org (Subject line is ignored).



More information about the Discuss mailing list