Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a ~50000 pictures:

  • located in multiple folders
  • not organized,
  • there are duplicates
  • source contains videos, but I need only pictures

I would like to organize all of them into subfolders automatically as:


either original filename or renamed something like YYYYMMDDHHMMSS.ext would be ok..

Should merge from multiple sources and should skip duplicates...

I tried iphoto and aperture but it wasn't working 100%

Thank you !

share|improve this question
Do you want targetdirectory to be in your home directory? How comfortable are you with the command line vs. a GUI solution? I'm working on writing up a little program that could solve your problem. – Daniel May 25 '12 at 3:16
Daniel, command line is fine.. I just cant believe this trivial not in some bigger apps.. I am also thinking to do a command line php script to organize them... Thank you – andraskende May 25 '12 at 3:25
@andraskende Is the date currently part of the filename or are you wanting this based on current date of the file? – E1Suave May 25 '12 at 8:51

You can use Hazel ( to organise and file your photos.

In Hazel you can create rules to act on files, these rules can be based on for example file metadata or EXIF information. The rule actions can create new folders and subfolders from these attributes and copy the files into the right location (it can also handle file name conflicts).

I found an example to set this one up on dpreview. (In step 4.c you specify that it should only work with pictures, it will ignore the videos).

The only thing you might need to do is to copy the files from the current folders into the folder where the Hazel rule will trigger.

share|improve this answer

I have a perl script which does something similar, my target directory is targetdirectory/YEAR/YEAR-MONTH-DAY, but this can easily be changed in your copy of the script:

If you have multiple directories you could run it as:

find . -name '*.jpg' | iphoto-copy-export-to-archive-dir targetdirectory

It would skip duplicates if they have same file name and same size.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.