How to grep only show path/filename?
grep, linux
Solution
`grep -l` will output JUST the names of files which matched, without showing the actual match.
Problem
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