Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2011-09-19
3
Medium Priority
?
358 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 12

Expert Comment

by:tel2
ID: 36565712
How about a recursive diff:
    diff -r dir1 dir2
0
 
LVL 4

Accepted Solution

by:
Ryan Weaver earned 2000 total points
ID: 36566237
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
ID: 36568516
Fryguy,

Thanks for the tip.
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

618 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