Compare two folders which has many files inside contents

vetri02 picture vetri02 · Oct 29, 2009 · Viewed 117k times · Source

Have two folders with approx. 150 java property files.

In a shell script, how to compare both folders to see if there is any new property file in either of them and what are the differences between the property files.

The output should be in a report format.

Answer

reko_t picture reko_t · Oct 29, 2009

To get summary of new/missing files, and which files differ:

diff -arq folder1 folder2

a treats all files as text, r recursively searched subdirectories, q reports 'briefly', only when files differ