Single line scripts

This page contains snippets of code in different languages. These one-liners are too small for a post, but are still very important to keep.

Thumbnail Images

# Convert all jpgs in the current directory into smaller ones:
for i in *.jpg; do echo $i; convert $i -geometry 500x500 small_$i; done;
# Same as above, but will handle names with spaces
for i in *.jpg; do echo $i; convert "$i" -geometry 800x800 "small/$i"; done;

One thought on “Single line scripts

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s