grep - Finding file location with a given string in it in Linux -


There are several files with names "log.xml" at different places in my file system in Linux.

I need to find the exact location of a "log.xml" file in which the string "Hello World!"

As usual, find is normal but annoying answer.

  / home / user1326379> / -name "log.xml" -exec grep -I -l -s \ 'Find Hello World!' {} \;  

grep option is to ignore binary files, just be silent for printing file names of files and for errors reading in OSX.


Comments