The FC (file compare) command is a Windows command line utility that allows users to compare the contents of two files or sets of files. It is a powerful tool for comparing files, and can be used to identify differences between two versions of the same file, or to compare two different files. The FC command is available in all versions of Windows, including Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP.

Syntax and Options for the FC CMD Command

The syntax for the FC command is as follows:

FC [/A] [/C] [/L] [/LBn] [/N] [/T] [/W] [/nnnn] [drive1:][path1]filename1 [drive2:][path2]filename2

The following options are available for the FC command:

  • /A – Displays only first and last lines for each set of differences.
  • /C – Ignores the case of letters.
  • /L – Compares files as ASCII text.
  • /LBn – Sets the maximum consecutive mismatches to the specified number of lines.
  • /N – Displays the line numbers on an ASCII comparison.
  • /T – Ignores tabs in files.
  • /W – Compresses white space (tabs and spaces) for comparison.
  • /nnnn – Specifies the number of consecutive lines that must match after a mismatch.

Examples of Using the FC CMD Command

The following are examples of using the FC command:

  • To compare two files, file1.txt and file2.txt located in the current directory, type the following command:

FC file1.txt file2.txt

  • To compare two files, file1.txt and file2.txt located in the C:\Test directory, type the following command:

FC C:\Test\file1.txt C:\Test\file2.txt

  • To compare two files, file1.txt and file2.txt located in different directories, type the following command:

FC C:\Test\file1.txt D:\Test\file2.txt

  • To compare two files, file1.txt and file2.txt located in different directories, ignoring the case of letters, type the following command:

FC /C C:\Test\file1.txt D:\Test\file2.txt

Conclusion

The FC command is a powerful tool for comparing the contents of two files or sets of files. It is available in all versions of Windows, and can be used to identify differences between two versions of the same file, or to compare two different files. The FC command has several options that allow users to customize the comparison process, such as ignoring the case of letters, ignoring tabs, and compressing white space. With the FC command, users can easily compare the contents of two files and identify any differences between them.

Leave a Reply