Need help in renameing files in terminal
Hi,
I have a collection of mp3 files that I would like to rename. I want to simply add a prefis to my files such as; hotel california.mp3 >>>>> eagles-hotel california.mp3 Do you knoe the rename command and its options to do this in the terminal? Thanks, FG |
Code:
mv hotel\ california.mp3 eagles-hotel\ california.mp3 Code:
mv "hotel california.mp3" "eagles-hotel california.mp3" |
How do i do this to multiple files at once.
Do I simply do: mv *.mp3 eagles-*.mp3 Thanks, FG |
there is a way, but i forget it has to do with building a string $ and changing things.
|
Do you have the rename command in your distro? From the man page:
Code:
rename will rename the specified files by replacing the first |
FYI, most Unix tools don't like spaces in filenames, so you have to either explicitly escape them or use quotes as mentioned above.
In short, don't put spaces in filenames if you can avoid it. |
Quote:
though the spaces may cause problems |
Quote:
Code:
mv: target `eagles-*.mp3' is not a directory |
Quote:
Code:
for i in *.mp3; do mv "$i" eagles-"$i"; done |
All times are GMT -5. The time now is 10:44 AM. |