###################
# Using 'rename'
###################
rename 's/\s/_/' * <--- for ubuntu
rename " " "_" * <---- for fedora
For example, to rename all files matching "*.bak" to strip the extension, you might say
rename 's/\.bak$//' *.bak
To translate uppercase names to lower, you'd use
rename 'y/A-Z/a-z/' *
###################
# Using 'mv'
###################
for FILE in *; do mv -- "$FILE" "`echo $FILE | sed 's/ /_/g'`"; done