Solved

perl, how to compare file contents from one folder to another

Posted on 2011-09-19
3
343 Views
Last Modified: 2012-05-12
There are 3 files in dir1.  I want to check if the 3 files are the same in dir2, so the three files exist in dir2 and have the same exact content.  Note, dir2 may have other files.
0
Comment
Question by:rgbcof
3 Comments
 
LVL 11

Expert Comment

by:tel2
Comment Utility
How about a recursive diff:
    diff -r dir1 dir2
0
 
LVL 4

Accepted Solution

by:
Ryan Weaver earned 500 total points
Comment Utility
You could use the File::Dircmp module to find the file name differences and combine that with File::Compare to check the files of the same name.
0
 

Author Closing Comment

by:rgbcof
Comment Utility
Fryguy,

Thanks for the tip.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now