grep -r 'pattern' dir/

Category: Text Processing

grep -r 'pattern' dir/

Recursively search for pattern in directory

Searches every file inside a directory and its subdirectories. -r means 'recursive'.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.