Home > Bash, linux, Tip > Diff text file remotely with local file

Diff text file remotely with local file

Found a pretty neat solution at http://www.genlinux.org/2009/04/remote-diff-in-linux.html for comparing remote and local files. For example, if I want to compare the file

remote_ip:~/myscript.sh with the local version, I no longer have to copy the remote file to a temporary location and do a local diff, instead, with the solution provided in the link above, I can simply do


ssh user@remote_ip 'cat ~/myscript.sh' | diff - path/to/local/myscript.sh
Advertisements
Categories: Bash, linux, Tip
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: