sshdiffbeyondcompare

Beyond compare remote with local file


I want to compare two text files one on remote the other local. With diff I would do that with

ssh user@login "cat myfile.txt" | diff - local.txt

Is there a way to perform the same comparison using Beyond Compare? If I do

ssh user@login "cat myfile.txt" | bcompare - local.txt

I get only the local file displayed.


Solution

  • One neat trick that I use in such cases is to use sshfs to make the remote directory appear as a local one to beyond compare:

    sshfs user@host:/opt/data /tmp/transfer
    

    Then you can use any diffing tool to compare your local data with the remote one via diff -Nur /local/data/dir /tmp/transfer or with beyond compare as usual and you can copy files back and forth as needed.

    Note, you might need to install sshfs via your package manager, e.g. on Debian/Ubuntu via apt-get install sshfs

    Possible options:

    See https://wiki.archlinux.org/index.php/SSHFS for more details.