TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [TCLUG:21649] Limits of grep?
Or:
ls -1 > filelist
awk '{ printf("grep string %s\n", $1) }' filelist > script.sh
chmod +x script.sh
./script.sh
awk owns your 'fro!
Adam Maloney
Systems Administrator
Sihope Communications
On Tue, 26 Sep 2000 bob@math.umn.edu wrote:
> 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
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tclug-list-unsubscribe@mn-linux.org
> For additional commands, e-mail: tclug-list-help@mn-linux.org
>
>