Results 1 to 3 of 3
How do you mass rename files from the command line? I have a bunch of mp3's with filenames like:
Artist_-_Album_-_TrackNumber_-_Track_name.mp3
I want to convert all the "_"(underscore) to " "(space). ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 08-31-2006 #1Just Joined!
- Join Date
- Aug 2006
- Posts
- 1
Mass rename of files replacing '_' with space
How do you mass rename files from the command line? I have a bunch of mp3's with filenames like:
Artist_-_Album_-_TrackNumber_-_Track_name.mp3
I want to convert all the "_"(underscore) to " "(space). I tried:
$ for i in *; do mv "$i" `echo $i | tr '_' ' '`; done
but it complains that:
mv: target `name.mp3' is not a directory.
What am i doing wrong?
- 09-01-2006 #2
I got's two you can try
for i in ./*.mp3; do mv echo "$i" "${i//_/ }"; done
if the output looks ok, remove the echo
OR
pipe this --> sed -e 's/ /_/'
kinda like this
find /mp3 -iname '*.mp3' -exec echo "$i" "`echo $i | sed -e 's/_/ /'" \;
- 09-04-2006 #3
Try:
Code:$ for i in *_*; do mv "$i" "`echo $i | tr '_' ' '`"; done


Reply With Quote
