q. I want to rename a dir of mp3s to add a 1 to the start of each filename. What's the best/easiest way to go about it?
a. Either of the following solutions should do it:
ls *.mp3 | (while read; do mv "$REPLY" "1${REPLY}"; done) (ta: petemc)
rename 's/(.*)/1$1/' * (ta: dw)
Labels: bash scripting, file manipulation
0 Comments:
Post a Comment
<< Home