grep exclude files code example
Example 1: grep exclude files
Just filter your output with:
grep -v "excluded_pattern"
Example to get all not txt files in current directory.
ls | grep -v .txt
Example 2: grep exclude
grep -R "what_you_want_to_capture" ./path_to_file/a.txt | grep -v "exclude this"
Example 3: grep exclude multi dirs
grep -inRw -E 'direct' . --exclude-dir={git,log,assets}