January 2, 2009

Removing White Spaces in File Name

Sometimes when you are transferring files to or from different devices or even computer running different OS, using spaces in file names can cause problems. Therefore I wrote this little script that removes white spaces from all the files in a given directory.

#!/bin/sh
for f in *; do mv "$f" `echo $f | tr --delete ' '`; done

No comments: