Rename multiple files at once

Chris Dawson xrdawson at gmail.com
Sun Jan 15 20:49:09 UTC 2006


Ronny,

First, open a terminal.  Then use the "cd" command (change directory)
to go to the directory where your files are stored.  For example, if
they are in Documents/images/foo, type "cd Documents/images/foo"

Then, use the bash "for" command to iterate over each file and apply a
change using the convert tool from imagemagick.  For example, if you
want to rotate by 90 degrees a bunch of jpg images, do this:

for x in *.jpg; do convert -rotate 90 "$x" "rotated-$x"; done

The *.jpg gets a list of all the files with jpg as the extension, the
"convert -rotate 90" command does the rotation, and the "for" command
iterates over each file.

Read more about convert by typing "convert --help"

Welcome to shell commands, a much more powerful way to process files
than using your mouse to click.

Chris

On 1/15/06, 'Forum Post <ulist at gs1.ubuntuforums.org> wrote:
>
> Ronny Haryanto Wrote:
> > On Sunday 15 January 2006 03:17, 'Forum Post, '@wailuku.xlogicgroup.com
> > wrote:
>
> > > Gimp works, but i have to do it picture for picture.
>
> > >
>
> > > I have 64 images to go.... i dont like the idea that i have to do 50
>
> > > images next week again..... so i am searching for the batch-method.
>
> > >
>
> > > I can resize, but not a group of images.
>
> >
>
> > If you have imagemagick installed, you can cook a short bash script
> > utilising
>
> > 'mogrify', like so (adjust seasoning to your liking):
>
> >
>
> > for img in *.jpg; do echo $img; mogrify -resize 640x480 $img; done
>
> >
>
>
>
> Oke.... I have imagemagick installed... but cant find a start-button or
> something. I guess its not a executable program like firefox/gimp etc?
>
> You tell me that i have to type the above.
>
> But where? In the main console????
>
> Should i first direct to the map containing the images?
>
> If yes... tell me.
>
> I'am (still) new to Linux and dont have the console into my hands.
> Mouse is more my way :P
>
>
>
> Ronny Haryanto Wrote:
> >
>
> > Run 'mogrify -help' for more options. Other useful program from
> > imagemagick
>
> > that I use quite often is 'convert'.
>
> >
>
>
>
> So it hasnt a real program?.... strange
>
>
>
> Ronny Haryanto Wrote:
> >
>
> > Ciao,
>
> >
>
> > Ronny
>
> >
>
> Thanks!
>
>
> --
> Zunflappie
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> http://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>




More information about the ubuntu-users mailing list