#!/bin/bash
find . -name "* *" |
while read name; do
na=$(echo $name | tr ' ' '_')
mv "$name" $na
done#!/bin/bash
#Replace all spaces in the files in current directory and subfolder with
#underline.
for x in `ls -R`; do mv "$x" `echo -n $x | tr " " "_"`; done