[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: Limits of grep?



Subba Rao forced the electrons to say:
> 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.

If your grep is GNU grep, then there is no limitation - except maybe a
limit on the sizeof (int) on the architecture.

The error is most likely from your shell, which seems to be enforcing
some kind of bound to the argv[] array of the program it spawns. Is this
on a Linux machine with shell as GNU Bash?

> Are there any other recommended tools to search through such large list of
> files?

man find - but beware - it is going to be slow.

Binand

-- 
The prompt for all occasions:
export PS1="F:\$(pwd | tr '/[a-z]' '\134\134[A-Z]')> "
--------------- Binand Raj S. (binand@xxxxxxxxxxxxxxxxxxxxx)