Finds recursively all folders in current folder which path not contains "NameToExclude" string and removes only ones without files and another folders within.
find . -type 'd' | grep -v "NameToExclude" | xargs rmdir