Can someone please help me figure out what the command syntax I need to use is?
Here is what I am wanting to do.
I have hundreds of thousands of files I need to look for a specific search string in.
These files are spread across multiple subdirectories from one main directory.
I would like to find a way to search through all these files, and everytime it sees a file with this specific search string in it, make a note of it in a log file.
So, for instance, I have the directory /files/accounting/
Under /files/accounting, I have LOTS of Microsoft Excel files that I want to search for the specific string "\\cttrut04\dept\" and then everytime it finds a file by that name, dump it to a log file.
I thought about something like:
find /files/accounting/ -name "*xls" | more | grep -i "\\clttrut04\dept" > \log\filelog.txt
This doesnt work. I am not sure how to do a find and then feed each file name it finds to more to search it and then grep it for the search string.
Can anyone help with this?
Thank you,
Brian