Posted in Command Line, Linux, PHP Searching text in a directory using find and grep Binny V A May 20, 2007 Leave a Comment on Searching text in a directory using find and grep Use find and grep to search for a specific text in a directory. In this example, we search for files which uses the PHP short tag – <? find -name '*.php' -exec grep '<?[^p\=]' {} \; Author: Binny V AA philosopher programmer who specializes in backend development and stoicism.