比较内容中有很多文件的两个文件夹 [英] Compare two folders which have many files inside contents

查看:37
本文介绍了比较内容中有很多文件的两个文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有两个文件夹,大约有.150 个 Java 属性文件.

Have two folders with approx. 150 java property files.

在 shell 脚本中,如何比较两个文件夹以查看其中是否有任何新的属性文件以及属性文件之间有什么区别.

In a shell script, how to compare both folders to see if there is any new property file in either of them and what are the differences between the property files.

输出应为报告格式.

推荐答案

要获取新文件/丢失文件的摘要,以及哪些文件不同:

To get summary of new/missing files, and which files differ:

diff -arq folder1 folder2

a 将所有文件视为文本,r 递归搜索子目录,q 报告'简要',仅当文件不同时

a treats all files as text, r recursively searched subdirectories, q reports 'briefly', only when files differ

这篇关于比较内容中有很多文件的两个文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆