DEV Community

Discussion on: Root to Linux: Search Files with Grep

Collapse
 
jmcp profile image
James McPherson

I have a niggle for your otherwise very nicely written piece.

You mention the -l flag:

It will search only the names of files containing selected lines.
Enter fullscreen mode Exit fullscreen mode

What -l actually means is it only print the names of files which contain the pattern you specify.

In addition, the GNU grep manpage says that "The scanning will stop on the first match." - which at first glance might imply that you only find the first file in the files being examined. To be precise, however, it means that for each file checked grep will stop checking that file if it has a match for the pattern.

Collapse
 
coffeecraftcode profile image
Christina Gorton

Thanks for the correction and additional information 😄