List only filenames whose content matches the search string at least once

zfgrep

  • Matches fixed strings in possibly compressed files.
    Equivalent to `grep -F` with input decompressed first if necessary.
    More information: <https://manned.org/zfgrep>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

zfgrep --files-with-matches {{search_string}} {{path/to/file1 path/to/file2 ...}}

click the source code to copy install zfgrep on any operating system with command-not-found.com