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

About Ajo Paul

A Monk who's yet buy his Ferrari!
This entry was posted in linux, script and tagged , . Bookmark the permalink.

One Response to 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 *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre user="" computer="" escaped="">