[Cialug] grep question

kristau kristau at gmail.com
Fri Apr 17 05:41:04 UTC 2020


I use this all the time. It works exactly as Tim described. Very useful Pro
Tip!

On Thu, Apr 16, 2020 at 8:27 PM <chris at bynw.com> wrote:

> ah. awesome. thanks Tim. I'll give it a shot.
>
> On 2020-04-16 20:11, Tim Wilson wrote:
> > It stops scanning that file if it finds a match. It will continue
> > scanning
> > each file Individually.
> >
> > On Thu, Apr 16, 2020 at 7:56 PM <chris at bynw.com> wrote:
> >
> >> I was wondering about that. But the man page detail reads:
> >>
> >>         -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.
> >>
> >> which makes me think the scanning will stop while I'm scanning
> >> multiple
> >> files and want them all scanned for the matching text.
> >>
> >>
> >>
> >>
> >> On 2020-04-16 19:49, Tim Wilson wrote:
> >> > I think what you’re looking for is -l (lowercase L). Or if you prefer
> >> > the
> >> > long option, --files-with-matches
> >> >
> >> > On Thu, Apr 16, 2020 at 7:33 PM <chris at bynw.com> wrote:
> >> >
> >> >> I have a question about using Grep. I have fgrep searching for a long
> >> >> string in several files. It's great it finds them so there is nothing
> >> >> wrong there. Just when I get the results it gives me the file name
> and
> >> >> the long string. How do I just get the file name as the output?
> >> >>
> >> >> Thanks!
> >> >>
> >> >> chris
> >> >> _______________________________________________
> >> >> Cialug mailing list
> >> >> Cialug at cialug.org
> >> >> https://www.cialug.org/cgi-bin/mailman/listinfo/cialug
> >> >>
> >> _______________________________________________
> >> Cialug mailing list
> >> Cialug at cialug.org
> >> https://www.cialug.org/cgi-bin/mailman/listinfo/cialug
> >>
> _______________________________________________
> Cialug mailing list
> Cialug at cialug.org
> https://www.cialug.org/cgi-bin/mailman/listinfo/cialug
>


-- 
Tired programmer
Coding late into the night
The core dump follows


More information about the Cialug mailing list