I have around 500 strings and I want to search for the files which contain them inside a directory and get the file names which contain the strings. So far I've been using:find -name 'LYFNRE.*' -exec grep -f file1.txt {} \; -printbut the problem is a string can be found in many files so it is difficult to find which strings are present and which are missing due to the huge output. Can you help me in printing the strings with their corresponding file names where they were found.
searching multiple strings in multiple files inside a directory and printing the string and corresponding file name where it was found
grep;search