diff: find differences of two files in remote machines
Scenario: we have two files in two remote servers and we want to find differences between them without copying files etc, the servers are server1 and server2, the filename is common on both servers and its name is file.txt
Assumptions:
- I assume that you have SSH connectivity on both server1 and server2
- I assume that the user you will use to connect has read access on the File system of server1 and server2
How to do it:
$ diff <(ssh user@server1 'cat /usr/local/files/file1.txt') <(ssh user@server2 'cat /usr/local/files/file1.txt')
I hope you found the article useful :)