TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [TCLUG:21649] Limits of grep?
Subba Rao allegedly wrote:
> Hi
>
> 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?
You might try this:
ls -1 > filelist
cat filelist | sed 's/^/grep a_string_of_importance /' > filelist
chmod 700 filelist
filelist
Yes, it makes a big file. No, you will not need to worry about the dread
"File argument list too long" message. And finally, yes, there is probably
a smarter way to do this.
HTH.
Adios,
Chris
--
C.S. Cornuelle
School of Mathematics/MCIM, University of Minnesota
206 Church St. SE, Minneapolis, MN 55455
(612) 626-8930v, (612) 624-2333f, bob at math.umn.edu
Ferventer Vestite