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.