Forums » General discussions » Replace spaces in filenames with underscores

In Unix, the following command can be used to replace all the spaces found in all the file names of a folder with underscores

find | while read FN;do mv "$FN" "`echo $FN | sed -e 's/ /_/g'`";done