Shell : Remove blank spaces from filenames

Just like I last posted the below script can be used to remove blank spaces from file names.

#!/bin/sh
find . -name "* *"|while read file
do
target=`echo "$file"|tr -s ' ' '_'`
mv "$file" "$target"
done

One thought on “Shell : Remove blank spaces from filenames

  1. Which is truly worth it to read, and does indeed make me wonder where it’s all going. We are curious can you supply even more information about this? I’m a bit puzzles to how this can all add together. My buddy did tell me a few days ago, around the lines of what you’re talking about, however it is still challenging to believe.

Leave a Reply

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

*