Compare all files content in two directory

linux, perl, unix

Solution

Here is what I would do:

diff -r --brief dir1 dir2

Problem

I need to compare a list of files present in two directory.Need to check whether two directory contents same number of files and the content of all the files in both the directory is same Assume that I can compare two files whether they have same content or not if files location are present. I need to check two directory content is same or not. use case: checking upgrade of a software where one directory contains all logs files generated while fresh install of the software and the other contains the all logs files generated while upgrading the software from lower version.

Original source