Question: How do I find all files containing specific text on Linux?
Answer: There could be a number of ways to find files containing specific text in Linux command line. My favorite way is to use Grep command here.
You can use the Grep command with a few options to achieve this.
grep -Ril "specific_text" <search_directory>
- R option search recursively in subdirectories and in symbolic links
- i option is for case-insensitive search
- l option will print only the name of the files instead of printing the matching lines
This will help you find all the files in the given directory and its subdirectories.
By the way, which commands do you use for finding all files with specific text?