hi every one....
i was trying to rename the no of files

Like
"Prison.Break.S01E01.HDTV.XviD-LOL.srt" to "Prison Break.101.srt"
and so on to the following files

Desktop/1/Prison.Break.S01E01.HDTV.XviD-LOL.srt
Desktop/1/Prison.Break.S01E02.HDTV.XviD-LOL.srt
Desktop/1/Prison.Break.S01E03.HDTV.XviD-LOL.srt
Desktop/1/Prison.Break.S01E04.HDTV.XviD-LOL.srt
Desktop/1/Prison.Break.S01E05.HDTV.XviD-LOL.srt
Desktop/1/Prison.Break.S01E06.HDTV.XviD-LOL.srt
Desktop/1/Prison.Break.S01E07.HDTV.XviD-LOL.srt
Desktop/1/Prison.Break.S01E08.HDTV.XviD-LOL.srt
Desktop/1/Prison.Break.S01E09.HDTV.XviD-LOL.srt

i tried to use

$mv "Prison.Break.S01E0[1-9].HDTV.XviD-LOL.srt" "Prison Break.10[1-9]"
mv: target `Prison Break.10[1-9]' is not a directory

then i run the second test
i tried to use

$mkdir fol
$mv "Prison.Break.S01E0[1-9].HDTV.XviD-LOL.srt" fol/

it was perfectly fine ....
is there any way to make it work ....

Edited 6 Years Ago by rhoit: n/a

mv can't mass-rename. It can rename a single file, or move a bunch of files into a directory - that's exactly what happened on your second attempt.
For a windows-style mass-rename you need to do something along the lines of (untested)

for f in $filelist; do
    mv $f `echo $f | sed -e 's/S01E0\([1-9]\).*/10\1/'`
done

Don't forget to initialize filelist accordingly. Make sure I didn't mistype anything (I don't have a linux machine right now)

This question has already been answered. Start a new discussion instead.