Get Rid Of Space In Filenames

Caveat: This solution relies on Linux, so ignore the rest if you are using a different operating system.

I like listening to the LATINUM-podcast provided by Evan Millner. As I currently have a pretty §?$% MP3-player (i.beat XTENSION) which lists the files according to their time stamp, I have to copy them to the MP3-player in the right order, one after the other, and with a generious 3 second delay after each file. As my computer is running Linux, I am using a short script to do that.

However, copying the LATINUM-files by script1 did not work at first due to the spaces in some of the file names. To get rid of these pesky spaces I simply enter the respective directory (using Bash) and run the following short script:

for f in *; do mv "$f" `echo $f | tr ' ' '_'`; done

Thanks to the guys (and gals?) at Linuxconfig.org for the hint.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License