How to do “diff -r” of UNIX in Windows Cmd Prompt?

后端 未结 9 1014
遥遥无期
遥遥无期 2020-12-28 14:17

How do I compare two directories on cmd prompt of Windows m/c? I want equivalent of diff -r of UNIX.

相关标签:
9条回答
  • 2020-12-28 15:13

    The comp command for Windows is what you're looking for.

    Here the example:

    To compare the contents of the directory C:\Reports with the backup directory \\Sales\Backup\April, type:

    comp c:\reports \\sales\backup\april 
    
    0 讨论(0)
  • 2020-12-28 15:17

    The easiest way would probably be downloading diff for Windows: http://gnuwin32.sourceforge.net/packages/diffutils.htm
    You could also do something like:

    dir directory1 > dir1
    dir directory2 > dir2
    comp dir1 dir2
    

    Also, some versions of Windows comes with windiff, however that is a GUI tool

    0 讨论(0)
  • 2020-12-28 15:17

    In Windows 10 you can run diff command in bash by Enabling the Linux Bash Shell

    0 讨论(0)
提交回复
热议问题