Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: List Duplicate Files in a given directory

by thanos1983 (Parson)
on Jul 31, 2017 at 08:53 UTC ( [id://1196332]=note: print w/replies, xml ) Need Help??


in reply to List Duplicate Files in a given directory

Hello pr33,

Well it seems that the fellow monks have provided you wisdom and most likely you have resolved your problem. But just for the record I would suggest also to read a similar question Find duplicate files..

I would also recommend to try also the module File::Find::Duplicates, It gives you the ability to check the md5.

Sample of code from the documentation:

use File::Find::Duplicates; my @dupes = find_duplicate_files('/basedir1', '/basedir2'); foreach my $dupeset (@dupes) { printf "Files %s (of size %d) hash to %s\n", join(", ", @{$dupeset->files}), $dupeset->size, $dupeset->md5; }

Hope this helps, BR.

Seeking for Perl wisdom...on the process of learning...not there...yet!

Replies are listed 'Best First'.
Re^2: List Duplicate Files in a given directory
by pr33 (Scribe) on Jul 31, 2017 at 16:59 UTC

    Thanks Thanos and thanks to all the Monks who have helped with this . Tried your solution and Choroba's . It is much faster especially when the directory has large number of files to compare as well as files with larger size.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1196332]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-03-28 13:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found