Tuesday, August 25, 2015

How to grep a string in a directory and all its subdirectories' files in LINUX?

If your grep supports -R, do:
grep -R 'string' dir/
If not, then use find:
find dir/ -type f -exec grep -H 'string' {} +

0 Comments: