I am wondering if there is a way to compare folders in Ubuntu? I have tried to organize my photo folders many times...and for this reason I have several folders that contain the same files (maybe a couple of extra ones) and it would be great to have a tool to figure out which files are extra and which files are identical.
P.S. I have just found an application that works well. It's called FSlint. Here is a link to it with a detailed description: http://www.addictivetips.com/ubuntu-linux-tips/clean-up-ubuntu-remove-duplicates-with-fslint-filesystem-lint/
diff will help you find duplicate files in two different directories, but if your mess is greater or if, for any other reason, you want to find duplicate (exact) image files in a whole directory, including subdirectories, you can use the gthumb image browser viewer, which is probably already installed in your system.
Gthumb provides a tool to search for duplicate media/audio/video/images/text/all files in a directory. To do this, just select your directory in the view mode that displays a left pane with your directory tree, and then, from the menu select Edit>Find duplicates... a dialogue window shows the duplicates and lets you choose which file(s) to delete. This procedure is visual and helpful in many cases; but it is slow, if you have too many duplicate files to delete.
just use
diff directory1 directory2
If you want to find duplicate files, you can use
fdupes
program as explained in this question: How to find (and delete) duplicate filesHowever, with a photo collection this won't find different versions of an image (you can have multiple copies of an image with different metadata, different resolution etc.)
To find dupolicated images you can use DigiKam, which is in general an awesome tool for managing a photo collection. It has Find Duplicate Images Tool:
You may want to have a look at dupeGuru Picture Edition. Seems like one of the best options to me, if not the best, handling also similar (non-identical) images.
For exact duplicates and scripting you might use duff.