find text in files linux code example
Example 1: find text in folder
grep -rnw '/path/to/somewhere/' -e 'pattern'
Example 2: bash find all files containing string
grep -r '/path/to/somewhere/' -e 'pattern'
Example 3: linux search for a given string in all files recursively
$ grep -r "String to be searched goes here" *
Example 4: find text pattern in file linux
grep -rnw '/path/to/somewhere/' -e 'pattern'
Example 5: bash find term in files
grep "some string" . -R
Example 6: linux find file containing text
find 'C:/Users/JacquesK' -name '*.*' -exec grep 'Random text to find' {} /dev/null \;