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?
You can use the diff command to show differences between two files, or each corresponding file in two directories. diff outputs differences between files line by line in any of several formats, selectable by command line options. This set of differences is often called a `diff' or `patch'.
The where command is a Windows which equivalent in a command-line prompt (CMD). In a Windows PowerShell the alternative for the which command is the Get-Command utility.
The fc (file compare) command is used to compare two files. 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 such.
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
Well, on Windows I happily run diff
and many other of the GNU tools. You can do it with cygwin, but I personally prefer GnuWin32 because it is a much lighter installation experience.
So, my answer is that the Windows equivalent of diff
, is none other than diff
itself!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With