How to exclude one folder and multiple folders from grep?
How to exclude one folder from grep?
grep --exclude-dir=vendor -r ".env" .
How to exclude multiple folders from grep?
grep --exclude-dir={vendor,tests,.git} -r ".env"
Note: there should not be any space after comma.