In a iPhoto Extraction thread on the macosxhints forum site, kerim discusses some issues he was having with iPhoto. For some reason, the photos in the iPhoto Library weren't showing up in iPhoto itself, so he wanted to copy them from the iPhoto directories to one new "flattened" directory.
iPhoto stores images in subdirectories organized by year and date, and kerim was wondering how to move all of the images at once. He had tried a Sherlock search on "*.JPG" in the iPhoto Library, but the program kept crashing when he tried to move the files from the results window (probably due to the 1700 items in the search results!). So he was looking for a Terminal solution.
Through some stumbling on my own, and with a large bit of help from a buddy, I came up with one solution (I'm sure there are other, more elegant, ways to do this). In the Terminal, first "cd" to the highest directory that contains all the files you wish to affect. Then type:
% cp `find . -name "*.jpg"` /path/to/new/folderThis will copy any files ending in ".jpg" (in any directory at or below the current level) to the location you specify in the "/path/to..." portion of the command. For the destination, make sure you use a path which is outside (different drive, anywhere else "above" the current directory, etc.) of the directory you're working in!
Mac OS X Hints
http://hints.macworld.com/article.php?story=20020703000120511