How do I Grep through a Sub Directory

If you are looking from something that is contained in a file but you don't know which directory it is in do the following:

find . -name "*" | xargs grep -i something

This will find all of the files in the directory and below and grep for the string something in those files!

If you use -il on grep then it will only list the files and will stop with the first file found in the directory that has a match.

Back to Menu