How to compare the files data in 2 different unix boxes

unix-shell

i have one file which exists in 2 different unix machines.
how i can compare the data with in the file

Best Answer

You can compare files remotely using ssh:

$ ssh -p 2022 localhost "cat /remote_path" | diff - /local_path
$ ssh -p 2022 localhost "cat /etc/lsb-release" | diff - /etc/lsb-release
2,4c2,4
< DISTRIB_RELEASE=10.10
< DISTRIB_CODENAME=maverick
< DISTRIB_DESCRIPTION="Ubuntu 10.10"
---
> DISTRIB_RELEASE=10.04
> DISTRIB_CODENAME=lucid
> DISTRIB_DESCRIPTION="Ubuntu 10.04.2 LTS"

Or use sshfs/nfs.