Such a question shows the power of bash programming. Method1 : ls -1 *.jpg | while read file; do mv "$file" \ "donald_$file"; done
Method2 : ls -1 *.jpg | awk '{ print "mv "$1" donald_"$1; } | \ /bin/bash Method3 : find -name "*.jpg" -exec mv {} donald_{} ';' On Fri, 30 Dec 2005 11:57 am, Jerry McBride wrote: > On Thursday 29 December 2005 08:24, Marco Calviani wrote: > > Hi list, > > maybe this question is a little bit related since it regards non > > Gentoo-specific topics. > > I would like to add a specific suffix to a list of files. For > > example i have files of the type: > > > > duck1.jpg > > duck2.jpg > > duck3.jpg > > > > and i would like them to become: > > > > donald_duck1.jpg > > donald_duck2.jpg > > donald_duck3.jpg > > > > Does somebody knows a simple way to do this via shell? > > Did anyone mention RENAME??? > > A simple "rename duck donald_duck duck*.jpg" would work well also.... > > Cheers. -- gentoo-user@gentoo.org mailing list