find.1posix . -depth -type d -name '* *' -execdir bash -c 'for i; do mv "i" "{i// /_}"; done' _ {} +
find files
source manpages: find