grep -rli --exclude-dir={dir1,dir2,dir3} keyword /path/to/search
grep -rli --exclude-dir=/path/to/exclude "keyword"