Web lists-archives.com

Re: An appropriate directory search tool?




On Sun 21 Oct 2018 at 10:33:41 (-0400), rhkramer@xxxxxxxxx wrote:
> On Sunday, October 21, 2018 09:48:28 AM David Wright wrote:
> > On Sun 21 Oct 2018 at 05:25:05 (-0500), Richard Owlett wrote:
> > > I wish a list of files with a specific extension in a directory which
> > > contain keywordA but not keywordB. Recursing down the directory tree
> > > was the primary objection to the MATE search tool.
> > 
> > At last, a direct question!
> > 
> > $ grep -L keywordB $(grep -l keywordA a-directory/*extension)
> 
> I am not the OP, and I haven't tried this out, but, reading the grep man page 
> for the -L (and the -l) option, I'm a little concerned by the sentence that 
> says ~"Scanning will stop on the first match" -- does that mean it will stop 
> scanning the particular file being scanned, or does that mean it will stop 
> scanning in the directory (or list of files) being scanned?

Read the full names of the options:
--files-without-match
--files-with-matches
      ↑

But the fact that scaanning stops can be important. When you get to
test it out for yourself, try using interactive standard input (-)
as an input file and you will see the difference when you add -l
as an option.

Cheers,
David.