How to resize multiple image with single command

I tend to be lazy .. hehehehe..

sometime I took a lot of picture then later don’t know how to select and post ..
some more need to resize each one of them before publish or send out to somebody else..

figured out.. by creating a simple bash script file with following content :


for i in `ls  *.JPG`
convert -verbose -resize 50% -comment "(c) HawkEYE Expression's" $i resized_${i%%.*}.jpg

* Updated to fix the filename extension to lower-cased..

Then have make it executable .. before can use .. by issuing this command.

chmod a+x  ~/bin/

to use it..

cd ~/where/to/image_folder/
~/bin/ .

it will take every single JPG file in the folder and resized it by 50% .. and renamed to resized_original_name.jpg
quite handy when to handle let’s say 300+ images…

p/s : can remove verbose string if don’t want to know the progress of the conversion process..
btw .. dependencies is :

[root@nb-namran ~]# rpm -q --whatprovides /usr/bin/convert

Get Free Email Updates!

Signup now and receive an email once I publish new content.

I will never give away, trade or sell your email address. You can unsubscribe at any time.


Related Post

3 Responses

  1. robfish88 says:

    Thank you very much…….

  2. robfish88 says:

    Kindly advice, I want to use OpenWRT for my TP-Link router model TL-WR1043ND version 1.10 starting serial number with 12.

    Requested for UNIFI Malaysia 20 MB

    Kindly advice which files I do need to download, highly appropriated in advance .



    (Shah Alam)

  3. robfish88 says:

    Good Morning ,
    I have a TL-WR1043ND router Ver 1.10 and not able to find Hardware version, as what I understood from other posts that this should be then Hardware version 1.
    Have installed OpenWRT in total 3 files :
    German stock firmware (v3.9.17)
    – attitude_adjustment 12.09-rc2 and
    attitude_adjustment 12.09-rc2 and able to able access my router TL-WRT1043ND

    I guess that it is my age (59) but I a losing it on the configuration and explanation, first the first of all on many images that I have seen on the internet in the part Internet -> Swith VLAN witch is starting with PORT 1 -2-3-4-5-CPU however on my installed OpenWRT it starts with PORT 0-1-2-3-4-CPU so I guess something is already wrong on my side, having said this most images are related to HARDWARE VERSION 1.8

    My main goal is to get connect to UNIFI Malaysia (20MB connection) I know that Unifi provides an IPTV package but to honest I don’t need this IPTV connection at all.

    The bottom line, I like get connected to UNIFI with OPENWRT and I am really begging f someone can assist me in to get connect to Unifi. I know it is labor day (May 1) but will be great full if somebody can assist me.


Leave a Reply to HawkEYE Cancel reply