Find Files Containing Specific Text in Linux

grep -iRl "your-text-to-find" ./

Here are the switches:
-i – ignore text case
-R – recursively search files in subdirectories.
-l – show file names instead of file contents portions.

./ – the last parameter is the path to the folder containing files you need to search for your text. In our case, it is the current folder with the file mask. You can change it to the full path of the folder.

Ref: https://winaero.com/blog/find-files-containing-text-linux/

Leave a Reply

Your email address will not be published. Required fields are marked *