Ssh – How do diff over ssh

diff()ssh

How do I diff files/folders across machines provided that the only connectivity available is ssh?

Best Answer

You can do it with Bash's process substitution:

 diff foo <(ssh myServer 'cat foo')

Or, if both are on remote servers:

diff <(ssh myServer1 'cat foo') <(ssh myServer2 'cat foo')