Learn about Linux
Download Linux
Get Linux help
Get special offers on:
Linux Application Dev Programming Software
Email:
#
Return to CLI Magic: For geek cred, try these one-liners
© Copyright 1999-2008 - SourceForge, Inc., All Rights Reserved About Linux.com - Privacy Statement - Terms of Use - Advertise - Trademark - Ask Linux Questions - Write for Us - RSS Feed ThinkGeek - Slashdot - SourceForge.net - freshmeat - Surveys - Jobs
CLI Magic: For geek cred, try these one-liners
Posted by: Anonymous [ip: 216.241.105.6] on July 23, 2008 03:52 PMThis is what I came up with:
for file in $(ls *.jpg) ; do convert -verbose -colors 8 ${file} ${file%.jpg}.gif ; done
8 hours later, it was done.
Next I had to convert a bunch of WAV files to MP3s and set the bit rate to 32. (all in multiple directories).
for DIR in $(ls -1) ; do for FILE in $(ls -1 ${DIR}/*.wav); do lame -b 32 "${FILE}" "${FILE%.wav}.mp3" ; done ; done
Remember loops for anything you have to do more than once.
#