Posts Tagged ‘spaces’

How to Remove Spaces from Filenames in Linux/UNIX

Wednesday, April 22nd, 2009

This command will rename all files that have spaces in their filenames, in the current directory and recursively in its subdirectories, so that in the new filenames all spaces are replaced with underscores (‘_’ characters). find . -name ‘* *’ | while read file; do target=`echo “$file” | sed ‘s/ /_/g’`; echo “Renaming ‘$file’ to [...]