grep max depth code example Example: recursive grep recursion depth find . -type f -maxdepth 2 -exec grep -l 'pattern' {} \;