[Cialug] grep(1)

Matthew Nuzum newz at bearfruit.org
Tue Jan 26 16:37:06 CST 2010


On Tue, Jan 26, 2010 at 4:32 PM, Todd Walton <tdwalton at gmail.com> wrote:

> gnu grep(1) 2.5.1-cvs says:
>
> -l, --files-with-matches
>       Suppress normal output; instead print the name of each input
> file  from  which  output  would
>       normally  have  been printed.  The scanning will stop on the
> first match.  (-l is specified by
>       POSIX.)
>
> So when I do 'grep string *.txt' am I going to get back every file
> that has string in it?  Or is it literally going to stop on the first
> match?
>
> It returns every file.  It stops searching each particular file on the
> first match, and then moves on to the next file.  It's ambiguous
> wording.
>
>
I use -l (that's lower case L) all the time. It prints each file name that
has at least one line that matches the regex. Each file name is on a
separate line.

-- 
Matthew Nuzum
newz2000 on freenode, skype, linkedin, identi.ca and twitter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cialug.org/pipermail/cialug/attachments/20100126/57d1244f/attachment.htm 


More information about the Cialug mailing list