Diff

如何區分 ssh?

  • April 21, 2021

如果唯一可用的連接是 ssh,我如何跨機器區分文件/文件夾?

最後我找到了很好的解決方案:vimdiff

vimdiff /path/to/file scp://remotehost//path/to/file

感謝http://linux.spiney.org/remote_diff_with_vim_and_ssh 另見http://www.vim.org/scripts/script.php?script_id=1075

您可以使用 Bash 的程序替換來做到這一點:

diff foo <(ssh myServer 'cat foo')

或者,如果兩者都在遠端伺服器上:

diff <(ssh myServer1 'cat foo') <(ssh myServer2 'cat foo')

引用自:https://serverfault.com/questions/59140