Thursday, July 12, 2012

compare / diff files over ssh - remote file vs local file

ssh remote_user@remote_ip "cat remote_file.ks" | diff  - localfile.ks

This logs into the remote server , concatenates the file and pipes it to diff.
Diff treats the remote file as stdin and compares with localfile

- having ssh key authentication helps as no need to enter the password of the remote server.

No comments:

Post a Comment

Followers

About Me

Torrance, CA, United States