What the option '-l' means is that once a file matches your string, it will print the name of the file and stop scanning that file for more matches. Then it will go and scan the next file.<br><br><div class="gmail_quote">
On Tue, Jan 26, 2010 at 4:32 PM, Todd Walton <span dir="ltr"><<a href="mailto:tdwalton@gmail.com">tdwalton@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
gnu grep(1) 2.5.1-cvs says:<br>
<br>
-l, --files-with-matches<br>
Suppress normal output; instead print the name of each input<br>
file from which output would<br>
normally have been printed. The scanning will stop on the<br>
first match. (-l is specified by<br>
POSIX.)<br>
<br>
So when I do 'grep string *.txt' am I going to get back every file<br>
that has string in it? Or is it literally going to stop on the first<br>
match?<br>
<br>
It returns every file. It stops searching each particular file on the<br>
first match, and then moves on to the next file. It's ambiguous<br>
wording.<br>
<font color="#888888"><br>
--<br>
Todd<br>
_______________________________________________<br>
Cialug mailing list<br>
<a href="mailto:Cialug@cialug.org">Cialug@cialug.org</a><br>
<a href="http://cialug.org/mailman/listinfo/cialug" target="_blank">http://cialug.org/mailman/listinfo/cialug</a><br>
<br>
</font></blockquote></div><br>