LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Deleting duplicate photos

[ILUG] Deleting duplicate photos

Brendan Kehoe brendan at zen.org
Mon Sep 29 20:11:05 IST 2008


Timothy Murphy wrote:
> What is the best way of eliminating duplicate photos
> on a number of machines, all running Linux (Fedora or CentOS)?
>
> I suppose one could ask the same question about files generally;
> how to tag or delete duplicates.
>
> Any suggestions gratefully received.
>   

I don't have the files handy at the moment, but my approach was to run
md5sum on every single one, and then write a perl script to use an
associative array to then emit commands to remove all of the ones after
the initial version.  Something like

   /([0-9]+)\s(.*)/ && do {
      if (exists ($files{$1}) {
          print "rm -vf ", $2;
      } else {
          chop;
          $files{$1} = $2;
      }
  };


A lot more sanity-checking needs to be done, but that was the idea.

Hope this helps,
B




More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell