使用 diff 并抑制完全不同的文件

发布于 2024-08-17 19:54:05 字数 140 浏览 2 评论 0原文

我有两个应用程序源代码的副本。一份副本已编码,而另一份则未编码。配置文件分散在应用程序的目录结构中,这就是我想要比较的。

有没有一种方法可以使用 diff 来忽略截然不同的文件(即:加密文件和未加密文件),并且仅报告相似但不同的文件(配置)上的差异。

I have two copies of an application source code. One copy is encoded, while the other is not. There are config files scattered through-out the application's directory structure, and this is what I would like to compare.

Is there a way to use diff where-by I can ignore the wildly different files (ie: An encrypted file and an unencrypted file), and only report the difference on the similar-yet-different files (The configs).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

别念他 2024-08-24 19:54:05

您可以编写一个脚本,使用 find 根据名称或其他条件查找文件,并使用 file 来确定它们是否具有相同类型的内容(即,一个是压缩的,一个是压缩的)不是)。

更具体地说,我需要您提供更多详细信息,说明这些是否是并行目录结构(文件和目录出现在两个树中的相同位置)以及您正在查找的文件是否具有将它们与文件区分开的名称你想忽略。您可以提供的任何其他信息可能会有所帮助。

You could write a script that uses find to find the files based on name or other criteria and file to determine whether they have the same type of contents (i.e. one compressed, one not).

For me to be more specific I would need you to give more details about whether these are parallel directory structures (files and directories appear in the same places in the two trees) and whether the files you are looking for have names that distinguish them from files you want to ignore. Any additional information you can provide might help even more.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文