Tuesday, November 13, 2018

How to grep to show just filenames

There is a standard option grep -l which does this.

-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.)