Anusha Pachunuri Anusha Pachunuri - 1 year ago 69
Linux Question

Diff command to compare files on different servers--Unix

Can I use the diff command to compare files on two different servers?
If not, is there any other option?

Answer Source

You can copy the file over from the other server using scp and then use diff.

Or ssh to the remote host and diff using a single command like this:

ssh user@remote "cat /path/to/remote/file" | diff - /path/to/local/file