Finding all files containing a text string on linux

I faced with the issue that how to find all files containing a text string on linux Just t do the following steps (I copy and paste from stackoverflow.com) grep -rnw 'directory' -e "pattern" -r is recursive, -n is line number and -w stands match the whole word. Along with these, –exclude or –include parameter could be used for efficient searching. Something like below: grep --include=\*.{c,h} -rnw 'directory' -e "pattern" This will only search through the files which have ....

April 14, 2015 · 1 min · longka