How do I search all files in a directory recursively with grep?
Use grep -r "pattern" /path/to/dir/. The -r flag tells grep to descend into subdirectories. Add -i for case-insensitive matching and -n to see line numbers in results. For large log directories, add --include="*.log" to avoid searching binary files.