Finding all files containing a text string on Linux

Here is the Command:

grep -rnw 'directory' -e "pattern"

-r or -R is recursive
-n is line number
-w stands match the whole word
-l (letter L) can be added to have just the file name.


	

Leave a comment