grep output to show only matching file
You can use the Unix-style -l
switch – typically terse and cryptic – or the equivalent --files-with-matches
– longer and more readable.
The output of grep --help
is not easy to read, but it's there:
-l, --files-with-matches print only names of FILEs containing matches
Also remember one thing. Very important
You have to specify the command something like this to be more precise
grep -l "pattern" *
-l
(that's a lower-case L).
grep -l
(That's a lowercase L)