mv command
I have a directory called command_expansion_test.
The directory contains the files: test.ogg, test2.ogg, test3.ogg. Using the mv command, how can I change the filenames to test.mp3, test2.mp3, test3.mp3 ? |
If you have the rename command, it straightforward as
Code:
rename .ogg .mp3 *.mp3 Code:
for i in `ls *.mp3` |
Code:
for i in `ls *.mp3` rename would be the easy way to do it. I never seem to want to do things the easy way however. This is mostly an academic exercise for me. I was at a LUG last night where the presenter used a string very similar to the one you provided to perform a *.ogg to *.mp3 name change to files in a directory. I've been banging my head against a wall trying to come up with a single string that can do it, but now I realize that it probably was a script. |
Well
I would say you're on the right track, I usually refer to this document for such tasks. |
Quote:
|
Quote:
Thanks for your help! |
All times are GMT -5. The time now is 10:55 AM. |