To search for a string within all PHP files including all subfolders, use the following command

To search for a string within all PHP files including all subfolders, use the following command:

Example:

1.
grep -rniE 'eval|base64_decode|gzinflate|shell_exec|exec\(|system\(|passthru|assert\(|proc_open|popen|curl_exec|file_get_contents|str_rot13|urldecode|preg_replace.*\/e' /var/www/html --include="*.php"

 

2.

grep -rniE 'my text' /var/www/html --include="*.php"