Remove spaces from files

find . -name ‘* *’ | while read file;
do
target=`echo “$file” | sed ‘s/ /_/g’`;
echo “Renaming ‘$file’ to ‘$target'”;
mv “$file” “$target”;
done

This entry was posted in Linux and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *