Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

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/

share|improve this question

marked as duplicate by Eric Carvalho, bain, chaos, Warren Hill, saiarcot895 Jul 18 at 20:39

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
I initially voted to close it as a duplicate but now I don't think it's a duplicate because it's about finding images. –  Sergey Nov 7 '12 at 23:43
    
This question appears to be relevant: askubuntu.com/questions/59107/… –  Anderson Green Dec 14 '12 at 4:57

4 Answers 4

up vote 6 down vote accepted

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.

share|improve this answer
    
Thanks for the answer. Can gthumb also compare 2 folders and tell me which files are the same or different in them? –  Elysium Nov 9 '12 at 1:09
    
I don't think so. Use diff for that or ... there are other tools, I can't recall their names, for that purpose. –  Robert Vila Nov 9 '12 at 2:14
    
What do you think about filezilla, xxdiff and kdiff3 filezilla-project.org kdiff3.sourceforge.net furius.ca/xxdiff –  Robert Vila Nov 9 '12 at 2:33
    
If you want to use gThumb, the following may be practical or not depending on the amount of files you have: You can put both directories inside a new directory; then use gThumb to find duplicates in that new dir; then you proceed to browse the results and/or delete the copies you want according to which directory they belong to. –  Robert Vila Nov 9 '12 at 3:29
    
Hey Robert. I must say that Gthumb is a great application, but I have just found 10.000 duplicates and deleting them one by one seems to be a tedious task to do. :) I need to find another way. –  Elysium Nov 9 '12 at 13:33

just use diff directory1 directory2

share|improve this answer
    
That wouldn't work well for directories full of binary files –  Sergey Nov 7 '12 at 23:31
1  
It would. All it says is only in directory1: someFile –  pbfy0 Nov 8 '12 at 0:00
    
Ok, you're right, diff is smart enough to not try to compare binary files line by line. And -r option even allows to compare directories recursively. Nice. –  Sergey Nov 8 '12 at 0:12

If you want to find duplicate files, you can use fdupes program as explained in this question: How to find (and delete) duplicate files

However, 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:

find duplicate images tool

share|improve this answer
    
I'll have a look and let you know how they work. Thanks. –  Elysium Nov 7 '12 at 23:49
    
Sorry to say, but this application has many issues. You cant select several images. I have 10.000 photos...so this is an application that would not replace the tedious manual work at all. Thanks anyway. –  Elysium Nov 10 '12 at 8:04
    
@Elysium: what do you mean by "You cant select several images"? I ran "Find duplicates" on my collection of photos, ~60.000 of them, and it appears to do what it says on the box. Unlike diff or any other file-based method, it also finds duplicates even if file format is different (JPEG/RAW etc.) –  Sergey Nov 10 '12 at 15:32

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.

share|improve this answer

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