通过命令行进行文件夹比较
我想比较Windows(Vista,XP)上的两个文件夹,其中有大量大文件,我需要比较。如果我使用Beyond Compare或者类似的工具来比较文件夹,如果我手动进行的话会花费很多时间。我需要将该文件夹比较添加到批处理文件中。
那么在 Windows(XP、Vista)上,是否有任何命令(内置)或任何第三方工具/实用程序(商业或免费软件)可以使用命令行比较两个文件夹。
I want to compare two folders on Windows (Vista, XP) which have a large number of huge files, which I need to compare. If I use Beyond Compare or such tool to compare the folders, it is taking a lot of time if I do it manually. I need to add that folder comparison to batch file.
So on Windows (XP, Vista), is there any command (built-in) or any 3rd party tool/utility (commercial or freeware - either) to compare two folders using the command line.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
您可以在 GnuWin32 找到为 Windows 编译的 GNU diffutils。
You may find GNU diffutils compiled for windows at GnuWin32.
您可以使用内置命令
COMP
。这在一定程度上取决于您实际想要比较的内容。使用类似
COMP c:\folder1 c:\folder2
的语法将folder1
中的所有文件与folder2
的内容进行比较。如果需要递归到子目录,则需要使用带有FOR
循环以及PUSHD
和POPD
命令的批处理脚本。如果您需要帮助,请发表评论。
There is the built in command
COMP
that you could use. It depends a little bit on what you actually want to compare.Use a syntax like
COMP c:\folder1 c:\folder2
to compare all files infolder1
with the content offolder2
. If you need to recurse into the subdirectories, you need to use a batch script using aFOR
loop and thePUSHD
andPOPD
command.Just leave a comment, if you need help with that.
我使用 Cygwin 版本的 Unix 命令行工具:
我还使用过 MinGW 过去。两者都有一些问题,但“足够接近”。对于视觉差异,我非常喜欢 WinMerge。
I use Cygwin's versions of the Unix command line tools:
I've also used MinGW in the past. Both have a few gotchas, but are "close enough." For visual diffs, I like WinMerge pretty well.
可以,但在第一次比较后我无法删除提示问题。
Will work, but I can't remove the prompt question after the first comparison is made.
根据 Martin Tournoij 的回答,我接下来写了(并且效果很好):
它在子目录中查找,不要问任何问题......
Basing on answer of Martin Tournoij I'v written next (and it working well):
It looks in subdirectories and don't ask any quiestions...
我的两个目录具有相同的结构,只是对文件进行了一些版本更改。此外,我的目录只是 python 文件的文件夹。所以我逃脱了...
My two directories have the same structure, just a few version changes to the files. Furthermore, my directory was just a folder of python files. So i got away with...