比较两个文件夹,里面有很多文件 [英] Compare two folders which has many files inside contents

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

问题描述

有两个文件夹,大约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天全站免登陆