[OOZY] Renaming more than 200 pics

gborzi ulist at gs1.ubuntuforums.org
Sun May 7 23:12:15 UTC 2006


To wipe the round brackets the commands are

> for i in *\(*; do newname=`echo $i|sed -e 's/(//g'`; mv -i "$i"
> $newname; done

> for i in *\)*; do newname=`echo $i|sed -e 's/)//g'`; mv -i "$i"
> $newname; done

don't forget the done at the end. The commands suggested by Charles E
\Rick\ Taylor IV actually change the round brackets to -.

Now to the double digit number. Here I need to know something more
about the files whose names are changed. Assuming they are of the form

> <something>-x.jpg

where x is a digit in the 0-9 interval the following command should
work

> for i in *-[0-9].jpg; do newname=`echo $i|sed -e
> 's/-\([1-9]\)\.jpg/-0\1.jpg/'`; mv -i "$i" $newname; done

all in one line.


-- 
gborzi




More information about the ubuntu-users mailing list