Often you have to resize images from a camera for using them on a website or a gallery or if you want to send them via email.
With the following command you can easily resize images inside of a directory ( the „imagemagick“ package must be installed on your system ).
for i in *.jpg; do echo "$i"; convert "$i" -resize 25% "$i"; done
(in some shells you have to remove the “ form $i):
for i in *.jpg; do echo $i; convert $i -resize 25% $i; done
If you would like to store the resized images in a separate folder, you can use these two commands:
// create folder with name resized mkdir resized //resize images and store the in folder resized for i in *.jpg; do echo $i; convert $i -resize 25% resized/$i; done
The „echo $i“ print out the files on the terminal.