grep through files
I have occasion to look for various text inside of files in a directory. Grep is great for that. To look for some text in a whole directory of files you can type on the command line grep matchtext *.txt. That will pull up the files with the matched text and print it out on the terminal. If you want a list of all the files with the text in it, you can add the -l flag.
grep -l “matchtext” /fullPath/*.txt
Providing you are in the directory to be searched when you run this command it will give you a list of all files with the word matchtext. It is searching in all the files that end in .txt in this case. In addition to using literal text values you can also use regular expressions in your match parameter.