10

I'm trying to locate the files which contain certain pattern, so I use grep -ir 'pattern' . to search all files under current directory. But I don't want to see the content of each file, I only need the path/filename. How can I do that?

Ps: Because some JSON file contains very long text in one line, then it will occupy the whole screen. I don't want to filter out those JSON files, because that's what I'm trying to locate

CodTango
  • 345
  • 1
  • 3
  • 15

1 Answers1

20

grep -l will output JUST the names of files which matched, without showing the actual match.

Marc B
  • 356,200
  • 43
  • 426
  • 500