Comparing files in Windows command prompt

comp command is used to compare 2 or more files.

Here is the syntax of comp command.

comp <file1> <file2>

To make the file comparsion in case-insensitive way, you can use below command.

comp <file1> <file2> /c



comp command does not tell exact differences between files. We have another command “fc” that tells exact differences between files.

Below image shows how “fc” command works.



To ignore the case and print line number as well, you can use below command.

fc names.txt names1.txt /N /C

You may also like...