How can I compare two directories, one being a remote directory?

I can think of two ways here..

  1. Mount your remote directory locally, and then use diff as you would do on a local machine.

  2. Use rsync:

rsync -avz --dry-run remote-user@remote-machine:remote-dir local-dir

This will show you the files that differ, but will not show you the actual diff. I think Unison supports diff also, but I have never used it and it does not seem to be under development any more.


If you just want to determine whether they're identical or not, something like

cd <directory>
find . -type f | sort | xargs sha1sum | sha1sum

...should give you a single checksum over the entire contents (except empty subdirectories). So you can run this on both machines and compare the outputs.