#$ grep -r --exclude-dir={path1,path2,path3,path4} -i --include=\*.php ' keyword ' /path/to/dir/
Explaination :-
-r : recursive
–exclude-dir=PATTERN : Exclude specific directory
-i, –ignore-case ignore case distinctions
–include=FILE_PATTERN : search only files that match FILE_PATTERN
#Extras
Grep multiple pattern
#$ grep 'keyword1\|keyword2\|keyword3' /path/to/dir/