Organize your pictures by EXIF tags with bash

Just a simple script to order your thousands of pictures by putting them in subdirectories on the basis of EXIF shot date:

# BashButler 1.0 - 11/2007 by Eugenio Rustico
# Bash script to organize your pictures in folders by date
# GPL v3 license

ls -1 *.jpg | while read fn
export dt=`exiv2 "$fn" | grep timestamp | awk '{ print $4 }' | tr ":" "-"`
if test ! -e ./$dt
mkdir $dt
mv "$fn" ./$dt
echo File "$fn" moved in "$dt"

echo Good job!

I wrote it to setup 4.900 pictures which were all in the same directory, and it was really fast and useful. My unstoppable sense of humor conceived this amazing script name: Bash Butler. I'm very sorry for this. =)

  • Of course you need exiv2 package on your system, but you can use other cli exif tools by modifying only one row;
  • With very little changes, you can modify the script to organize your pictures by different EXIF tags (e.g. different folders for different digital cameras);
  • Filenames with spaces are treated correctly;
  • By default mv does'nt overwrite destination files: so all remaining files in current directory are copies, and can be deleted.
GPL license v.3, of course.

NVIDIA 1.0-9629 on Debian testing

Being on the testing branch of Debian is cool; you have recent software, fresh updates, and plenty of little problems to solve.

Some days (weeks?) ago, after an apt-get dist-upgrade, graphic acceleration on my laptop stopped working. I didn't play with 3D things for a long time, so I realized just some days ago that the nvidia driver was not loaded anymore.

Why? Well... Who could say? Probably something changed (gcc, kernel subversion, xorg) and nvidia driver got angry for that. So, again and again:

aer:/pozzo# sh ./

But xorg couldn't find any "nvidia" driver. Among my tries, there was:

aer:/pozzo# cp /usr/X11R6/lib/modules/drivers/* /usr/lib/xorg/modules/drivers/

Yeah, I know, it was rough: soft linking would have been much more efficient (and more elegant). Anyway, after this, all worked.

One day later I found out a new driver version was available (100.14.19), and this latter one didn't require any workaround. Too late...