Unix Search folder for files containing a particular string

To search a folder recursively for files that contain a specific string using this

grep -rnw -e '' .

Note that this searches the file content. to search for string in file name use this

find . ! -name '*gz' -type f -delete

Leave a Comment