On Sun 21 Oct 2018 at 11:45:49 (-0400), rhkra...@gmail.com wrote: > On Sunday, October 21, 2018 11:21:35 AM David Wright wrote: > > On Sun 21 Oct 2018 at 10:33:41 (-0400), rhkra...@gmail.com wrote: > > > On Sunday, October 21, 2018 09:48:28 AM David Wright wrote: > > > > $ 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. > > Thanks for the reply, and I like that ability to use standard input! > > I tried the following, and the output from -L and -l seems almost the same, > except for that extra line that says "(standard input)" when I use the -l > option. > > Any further clarification / clues would be appreciated.
Use neither option to see the difference with using either -l or -L. So that standard output doesn't clutter the output, I suggest redirecting it thus: $ grep test - >| /tmp/a ; echo "and the output is" ; cat /tmp/a Then you will see the difference when you add -l as an option. Cheers, David.