Last Updated: February 25, 2016
·
721
· dipakd

Diff a remote file with a local file on linux

In below command we are running a cat command on the remote file through an ssh session and use the output to diff with the local file.

ssh account@remotehost "cat {pathtoremotefile}/file.txt" | diff - {pathtolocal_file}/file.txt