## Bulk resize images and keeping original files

Suppose you have a directory (with subdirectories) full of images, and you want to resize them all while keeping the original images. To do so, first create a copy of the directory tree without the image files. Then, using a for loop, find each image file and apply the convert command to it. The following is an example to resize jpg files to 40% of the original quality.

mkdir /path/to/mirror_dir
find /path/to/image_dir -type d -exec mkdir -p /path/to/mirror_dir/{} \;
cd /path/to/image_dir
for i in $(find -iname "*.jpg"); do echo$i; convert -resize 40% $i /path/to/mirror_dir/$i; done


## (Batch) Amplify audio files from the command line

Audacity is great, but it’s a GUI and sometimes I just want to do basic things like amplify the sound of some mp3 files. Discovered mp3gain from this thread and wrote this script to batch amplify the files:

 <pre class="src src-sh"><span style="color: #ff4500;">#</span><span style="color: #ff4500;">! /bin/</span><span style="color: #00ffff;">bash</span>


## http://boards.straightdope.com/sdmb/archive/index.php/t-339352.html