grep for string in files that match an extension in directory and subdirectories code example Example: grep only in php files grep -r -i --include=\*.php 'searchterm' ./