- If we want to exclude abc/ and xyz/ directory (in root directory) form grep's results we can do this: grep -rn --exclude-dir={abc,xyz} "text to find"
- If we want to exclude abc/def/some_thing_special/ghi...: grep -rn --exclude-dir={some_thing_special} "text to find"
- Do you know how to exclude the whole directory path?
Exclude directory from grep search
· One min read