Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Diff command to compare files on different servers--Unix [closed]

Tags:

linux

unix

diff

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

like image 211
Anusha Pachunuri Avatar asked Dec 21 '11 17:12

Anusha Pachunuri


1 Answers

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
like image 51
dogbane Avatar answered Nov 09 '22 23:11

dogbane