#2 Finding Duplicate Files
Duplicate files are a problem for me. I'll download pictures from my camera, forget I downloaded them, and download them again. I also get a lot of audio files from the Internet and many are duplicates of items I already have.[*] The result is that there's a lot of needless duplication on my system. So a script that locates duplicate files can be very useful when doing spring cleaning on a hard drive.
[*] Note to the MPAA: These are old radio shows from the '30s and '40s and the copyrights have long expired. So don't sue me.
The Code
1 #!/usr/bin/perl 2 use strict; 3 use warnings; 4 use File::Find; 5 use Digest::MD5; 6 7 ########################################################### 8 # find_dups(@dir_list) -- Return ...
Get Wicked Cool Perl Scripts now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.