28 How to replace spaces in file names and folder with underscore?

find /tmp/ -depth -name "* *" -execdir rename 's/ /_/g' "{}" \;

Above is thanks to Dennis Williamson from http://stackoverflow.com/questions/2709458/bash-script-to-replace-spaces-in-file-names

Seems to work well.