sabith
sabith

Reputation: 51

script for finding difference between subfolders of two folders in unix

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...

Upvotes: 1

Views: 686

Answers (1)

kenske
kenske

Reputation: 2354

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).

Upvotes: 1

Related Questions