I want to search recursively for “MY:STRING” string in files whose name contains “20121218” in them, the output should give me the file name and location. Search should look in files under sub-directories as well.
I want to search recursively for MY:STRING string in files whose name contains 20121218
Share
Use
findandgrep:Explanation:
findthe command find..start looking in the current directory.-type fonly interested in files.-namefilename match against'*20121218*'-execexecute the following command on the files found.fgrepfixed string grep.-lprint only filenames that contain a match.{}the list of matched files fromfindcommand.\;delimiter.Edit: