我有两个目录 – 一个来自早期备份,另一个来自最新备份.如何比较
Linux上最新备份对目录中文件所做的更改?另外我如何显示例如文本和php文件的变化 – 我正在考虑像维基百科上的修订历史,你在屏幕的一侧看到旧版本,在其他版本上看到最新版本,并突出显示更改.我如何实现这样的目标?
编辑:
我如何比较远程目录与本地?
解决方法
来自diff手册页:
If both from-file and to-file are directories,diff compares corresponding files in both directories,
in alphabetical order; this comparison is not recursive unless the -r or –recursive option is given.
diff never compares the actual contents of a directory as if it were a file. The file that is fully
specified may not be standard input,because standard input is nameless and the notion of ‘‘file with
the same name’’ does not apply.
所以要比较目录:diff –brief -r dir1 dir2
并排比较文件:diff –side-by-side file1 file2
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。