Remove Whitespace from File and Directory Name

How to remove all white space from directory names and file names recursively. Use rename (aka prename) which is a Perl script which may be on your system already.

Do it in two steps:

find -name "* *" -type d | rename 's/ /_/g' # do the directories first

find -name "* *" -type f | rename 's/ /_/g'