How grep show only path / file name?

I am trying to find files that contain a specific pattern, so I use grep -ir 'pattern' . to search for all files in the current directory. But I do not want to see the contents of each file, I only need the path / file name. How can i do this?

Ps: Since some JSON file contains very long text on one line, it will occupy the entire screen. I do not want to filter out these JSON files because this is what I am trying to find

+5
source share
1 answer

grep -l will output JUST file names that match, without displaying the actual match.

+15
source

Source: https://habr.com/ru/post/1208085/


All Articles