fc
小猪老师 发表于 2020-06-22 10:03浏览次数:
fc(文件比较)命令用于比较两个文件。
一旦fc运行并完成,它将返回两个文件之间不同的行。
如果没有不同的行,您将收到一条消息指示消息。
The fc (file compare) command is used to compare two files to one another. Once fc is run and completed, it returns lines that differ between the two files. If no lines differ, you will receive a message indicating as such.
目录:
1 fc 运行系统环境
2 fc 语法
3 fc 示例
fc 运行系统环境
Windows 95
Windows 98
Windows xp
Windows vista
Windows 2000
Windows 7
Windows 8
Windows 10
Windows NT
Windows ME
MS-DOS 3.3x及以上
fc 语法
比较两个或一组文件,并显示它们之间的差异。
FC [/A] [/C] [/L] [/LBn] [/N] [/T] [/W] [/nnnn] [drive1:][path1]filename1 [drive2:][path2]filename2
FC /B [drive1:][path1]filename1 [drive2:][path2]filename2
/A
|
只显示每个不同处的第一行和最后一行。
|
/B
|
执行二进制比较。
|
/C
|
不分大小写。
|
/L
|
将文件作为 ASCII 文字比较。
|
/LBn
|
将连续不匹配的最大值设置为指定的行数。
|
/N
|
在 ASCII 比较上显示行数。
|
/T
|
不要将制表符扩充到空格。
|
/W
|
为了比较而压缩空白(制表符和空格)。
|
/nnnn
|
指定不匹配处后必须连续匹配的行数。
|
[drive1:][path1]filename1
|
指定要比较的第一个文件或第一个文件集。
|
[drive2:][path2]filename2
|
指定要比较的第二个文件或第二个文件集。
|
Compares two files or sets of files and displays the differences between them.
FC [/A] [/C] [/L] [/LBn] [/N] [/T] [/W] [/nnnn] [drive1:][path1]filename1 [drive2:][path2]filename2
FC /B [drive1:][path1]filename1 [drive2:][path2]filename2
/A
|
Displays only first and last lines for each set of differences.
|
/B
|
Performs a binary comparison.
|
/C
|
Disregards the case of letters.
|
/L
|
Compares files as ASCII text.
|
/LBn
|
Sets the maximum consecutive mismatches to the specified number of lines.
|
/N
|
Displays the line numbers on an ASCII comparison.
|
/T
|
Does not expand spaces
|
/W
|
Compresses white space (tabs and spaces) for comparison.
|
/nnnn
|
Specifies the number of consecutive lines that must match after a mismatch.
|
[drive1:][path1]filename1
|
Specifies the first file or set of files to compare.
|
[drive2:][path2]filename2
|
Specifies the second file or set of files to compare.
|
fc 示例
fc autoexec.bat config.sys
在当前目录中的config.sys和autoexec.bat之间进行文件比较。
fc c:\autoexec.bat c:\config.sys /b
以二进制格式在根目录中的config.sys和autoexec.bat之间进行文件比较。。
fc "C:\Program Files (x86)\A.txt" "C:\Program Files (x86)\B.txt"
如果您的目录或文件名包含空格,则可能需要在完整路径周围添加引号,如本示例所示。
fc autoexec.bat config.sys
Gives a file comparison between the config.sys and the autoexec.bat in the current directory.
fc c:\autoexec.bat c:\config.sys /b
Gives a file comparison between the config.sys and the autoexec.bat in the root directory in binary format.
fc "C:\Program Files (x86)\A.txt" "C:\Program Files (x86)\B.txt"
If your directory or file name has spaces, it may be necessary to add quotes around the complete path as shown in this example.