0 Members and 1 Guest are viewing this topic.
for i in `ls`do dst=`echo $i | sed -e "/1\./s//\./"` echo "mv -v $i $dst"done
rename -v 1.avi .avi *1.avi
rename 1.avi .avi *1.avi
How about a one-liner (assuming the '1.avi' is constant and all files are in the same folder) :Code: [Select]rename -v 1.avi .avi *1.avi
rename -v 's/1.avi/.avi/' *1.avi
Just to be pedantic, the Unix/Linux command for renaming files is "mv" rather than "rename" ... :-)
for f in *1.avi; do mv "$f" "${f/1.avi/.avi}"; done
OK, the mv version (slightly longer) would be:Code: [Select]for f in *1.avi; do mv "$f" "${f/1.avi/.avi}"; done
'Fraid nothing happened!
Any idea why that is?
Sent from my rk30sdk using Tapatalk HD