Search code examples
windowscmddiff

What is the Windows equivalent of the diff command?


I know that there is a post similar to this : here.
I tried using the comp command like it mentioned, but if I have two files, one with data like "abcd" and the other with data "abcde", it just says the files are of different sizes. I wanted to know where exactly they differ. In Unix, the simple diff tells me which row and column, the comp command in windows works if I have something like "abd" and "abc". Not otherwise. Any ideas what I can use for this?


Solution

  • Run this in the CMD shell or batch file:

    FC file1 file2
    

    FC can also be used to compare binary files:

    FC /B file1 file2