Search for text in files of certain types, recursively
Suppose you want to search a whole directory (and it’s sub-directories) for files of certain type containing a certain string.
grep -r "test" *.php will fail, because
*.php will not match the sub-directories at all, and only provide results from the current directory, you can use the following function. Just add the code below in your home directory’s
Restart your session and you can use it like this: