文件夹比较通过命令行 [英] Folder Comparisons Via Command Line

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

问题描述

我想比较Windows(Vista,XP)上的两个文件夹,它们有大量的巨大文件,我需要比较。如果我使用Beyond比较或这样的工具来比较文件夹,如果我手动做它是花费大量的时间。

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.

因此在Windows(XP,Vista)上,有任何命令(内置)或任何第三方工具/

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.

推荐答案

有一个内置的命令 COMP 。这取决于你真正想要比较的一点。

There is the built in command COMP that you could use. It depends a little bit on what you actually want to compare.


比较两个文件或
组文件的内容。

Compares the contents of two files or sets of files.

COMP [data1] [data2] [/ D] [/ A] [/ L]
[/ N = number] [/ C]

COMP [data1] [data2] [/D] [/A] [/L] [/N=number] [/C]

data1指定要进行比较的第一个文件的位置和
名称。

data1 Specifies location and name(s) of first file(s) to compare.

data2指定要比较的第二个文件的位置和
名称。

data2 Specifies location and name(s) of second files to compare.

/ D显示
十进制格式的差异。

/D Displays differences in decimal format.

/ A显示
差异

/A Displays differences in ASCII characters.

/ L
显示差异的行号。

/L Displays line numbers for differences.

/ N = number仅比较每个
文件中第一个
指定的行数。

/N=number Compares only the first specified number of lines in each file.

/ C比较文件时忽略
ASCII字母。

/C Disregards case of ASCII letters when comparing files.

要比较文件集,请在data1和data2参数中使用通配符。

To compare sets of files, use wildcards in data1 and data2 parameters.

使用 COMP c:\folder1 c:\folder2 的语法来比较 folder1 中的所有文件 folder2 的内容。如果需要递归到子目录中,则需要使用 FOR 循环和 PUSHD 的批处理脚本 POPD 命令。

Use a syntax like COMP c:\folder1 c:\folder2 to compare all files in folder1 with the content of folder2. If you need to recurse into the subdirectories, you need to use a batch script using a FOR loop and the PUSHD and POPD command.

如果您需要帮助,请发表评论。

Just leave a comment, if you need help with that.

这篇关于文件夹比较通过命令行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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