Windows 命令行二进制差异工具

Gra*_*ant 6 diff command-line

是否有免费的 Windows 命令行diff工具?

我需要比较两个二进制文件,看看它们是否不同。我对它们的不同之处不感兴趣,我只需要知道它们是否不同。

A D*_*arf 11

使用cmd.exe下的comp命令

[C:\]comp /?
Compares the contents of two files or sets of files.                                                                    

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

  data1      Specifies location and name(s) of first file(s) to compare.                                                
  data2      Specifies location and name(s) of second files to compare.                                                 
  /D         Displays differences in decimal format.                                                                    
  /A         Displays differences in ASCII characters.                                                                  
  /L         Displays line numbers for differences.                                                                     
  /N=number  Compares only the first specified number of lines in each file.                                            
  /C         Disregards case of ASCII letters when comparing files.                                                     
  /OFF[LINE] Do not skip files with offline attribute set.                                                              

To compare sets of files, use wildcards in data1 and data2 parameters. 
Run Code Online (Sandbox Code Playgroud)

  • 还有 fc 命令用于更灵活的文件比较,以防需要类似 diff 的行为。 (3认同)
  • 我认为您应该编辑您的答案以提及“fc”。这似乎也很有用。 (3认同)
  • 使用 comp 的额外好处是您知道它可以在任何 Windows 机器上运行,而无需安装任何东西。 (2认同)