Take the 2-minute tour ×

I have two folders named 'check' in two places. Both will have same folders but the files of each folder may differs. I want to run a script to find the difference between the folders with same name in each 'check' folder then I have to redirect the difference to a file. Please anyone help me..

Thanks in advance...

share|improve this question
Did you try diff --help? –  devnull Apr 16 '13 at 4:59

1 Answer 1

Use rsync's dry run option and save the output:

rsync -avzn path/to/source/check path/to/dest/check > differences.txt

Reverse the order of the paths to find the remaining half of the diff.

You should also look into Unison, it's a directory synchronization tool. There's even a GUI for it (unison-gtk).

share|improve this answer
but as per your code i am getting all the files in subfolders of first folder. –  sabith Apr 16 '13 at 6:50
actually I need to traverse through both 'check' folders and find the difference in the subfolders with same name in both. Usually both the folder having same folders with same contents. The script is for running to check if any difference is there or not. The script should be like script_name check –  sabith Apr 16 '13 at 6:55

Your Answer


