I want to show text files that contain a string and to count them. My code is:
grep -l "string" file1.txt file2.txt | wc -l
It shows the number of files that contain "string". How can I show the names of the files too?
I want to show text files that contain a string and to count them. My code is:
grep -l "string" file1.txt file2.txt | wc -l
It shows the number of files that contain "string". How can I show the names of the files too?