This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(5)
您可以使用
scp
从其他服务器复制文件,然后使用diff
。或者使用如下命令
ssh
连接到远程主机并diff
:You can copy the file over from the other server using
scp
and then usediff
.Or
ssh
to the remote host anddiff
using a single command like this:我知道这是一个迟到的答案,但我从字面上理解这个问题,没有本地文件和两个远程文件。
在
bash
中(不仅如此),可以使用进程替换 [1,2]<(...)
:注意
<(...)
之一。如果两个文件位于同一服务器上,您可以使用更简单的
I know it's a late answer but I take the question literally, no local file and two remote files.
In
bash
(and not only) it's possible to use the process substitution [1,2]<(...)
:Note
<(...)
.If both files are on the same server you can use a simpler
如果您比较多个文件,请查找 rsync 和 rdiff,它可以节省您复制所有文件的带宽。
顺便说一句,如果您的文件非常大,请使用该信息更新您的问题。
If your comparing multiple files, then look up rsync and rdiff, which save you the bandwidth of copying all files.
Btw, if your files are very large, then please update your question with that information.
“-”与 STDIN 不同。你可以这样做:
The "-" diffs against STDIN. You can do something like this:
如果您正在对 AWS 实例进行故障排除,那么停止 inatanceA 然后将其驱动器连接到您想要比较的实例 B 可能是有意义的。
If you're troubleshooting AWS instance then it may make sense to stop inatanceA then attach its drive to instanceB you're want to compare with.