Use Grep To Find Text In Folders
Apr 3, 2009 · 1 minute readCategory: linux
This is post is now quite old and the the information it contains may be out of date or innacurate.
If you find any errors or have any suggestions to update the information please let us know or create a pull request on GitHub
This snippet of code will search all php files within a specified folder. It will check through all files and sub folders for the string id=“something”
find /path/to/root/search/folder/ -name "*.php" -print0 | xargs -0 grep 'id="something"'