Convert filenames with spaces?
Hello, I have a lot of data I want to transfer from my windows partion to my linux partition. It is a lot of mp3's, ebooks and so on. But these files contains spaces in their names, and linux doesn't seem to support that so well. It seems a space is converted to "\ " in the console. It looks bad, and I can't use the tabcompletion.
I have read it is recommended to convert spaces to underscores, and upper cases letters to lower case. If I have a directory full of mp3's, how can I do this conversion with a simple command? Thanks, /Mack |
You might want to use filename substitution in Bash.
Code:
cd <source directory> The "\ " in the names that you mentioned allow you to have a space treated literally with a command. The backslash is not a part of the name. The "//" two forward slashes in the destination part will replace all of the spaces to underscores. A single slash would have just replaced the first space. |
All times are GMT -5. The time now is 02:13 PM. |