grep -rlZ --exclude-dir=dir1 --exclude-dir=dir2 HUMAN . | xargs -r0 rm -f If you want find to do the directory traversal:
find . -type d \( -name dir1 -o -name dir2 \) -prune -o \ -type f -exec grep -lZ HUMAN {} + | xargs -r0 rm -f Portably/standardly, that would have to be:
find . -type d \( -name dir1 -o -name dir2 \) -prune -o \ -type f -exec grep -q HUMAN {} \; -exec rm -f {} + but that means running one grep per file.
For --exclude-dir={dir1,dir2} to work, you need a shell with brace expansion support like csh, tcsh, ksh, zsh, bash or fish.