FC

(from File Compare)

Compares two files or groups of files and displays the differences. See also the COMPCOMP command, which has similar functions.

Syntax:

FC [/A] [/C] [/L] [/LBn] [/N] [/T] [/U] [/W] [/nnnn] [OFF[LINE]] [drive1:][path1]file1 [drive2:][path2]file2
FC /B [OFF[LINE]] [drive1:][path1]file1 [drive2:][path2]file2

Where:

  • /A - Displays only the first and last rows for each set of differences.
  • /B - Performs a binary comparison.
  • /C - Ignores case.
  • /L - Compares files as ASCII texts.
  • /LBn - Sets the maximum number of consecutive mismatches to the specified number of n lines.
  • /N - Displays line numbers in an ASCII comparison.
  • /OFF[LINE] - Does not ignore files with "offline" attribute.
  • /T - Does not expand tabs to spaces.
  • /U - Compare files as UNICODE files.
  • /W - Compresses whitespace for comparison.
  • /nnnn - Specifies the consecutive number of rows that must match after a mismatch.
  • [drive1:][path1]file1 - Specifies the first file (or group of files) to compare.
  • [drive2:][path2]file2 - Specifies the second file (or group of files) to compare.

Examples:

1. Compare the file C:\shut.log and the file C:\go away!.log ignoring the case sensitivity:

fc /c "C:\shut.log" "C:\go away!.log"

 

2. Compare in binary code the file C:\a\b\c\d\e\f\g\h\i.sys with the file C:\a\b.sys compressing whitespaces:

fc /b /w "C:\a\b\c\d\e\f\g\h\i.sys" "C:\a\b.sys"

Comments