mattalxndr mattalxndr - 1 year ago 63
Linux Question

Grep: Excluding a specific folder using

Say our folder structure looks like this:


I want to recursively search
but I do not want to search

From within the app folder, what would my grep command look like?

Answer Source

This will do the trick

grep -r --exclude-dir='secondary/data' PATTERN data