fc
Compares two files or sets of files and displays the differences between them. Windows commands reference
On Windows File fc.exe
Windows
fc /a [/c] [/l] [/lb<n>] [/n] [/off[line]] [/t] [/u] [/w] [/<nnnn>] [<drive1>:][<path1>]<filename1> [<drive2>:][<path2>]<filename2>fc /b [<drive1:>][<path1>]<filename1> [<drive2:>][<path2>]<filename2>fc /a monthly.rpt sales.rptfc /b profits.bat earnings.bat00000002: 72 4300000004: 65 3A0000000E: 56 92000005E8: 00 6EFC: earnings.bat longer than profits.batComparing files profits.bat and earnings.batFC: no differences encounteredfc *.bat new.bat
Show 17 options
/aAbbreviates the output of an ASCII comparison. Instead of displaying all of the lines that are different, fc displays only the first and last line for each set of differences./bCompares the two files in binary mode, byte by byte, and does not attempt to resynchronize the files after finding a mismatch. This is the default mode for comparing files that have the following file extensions: .exe, .com, .sys, .obj, .lib, or .bin./cIgnores the letter case./lCompares the files in ASCII mode, line-by-line, and attempts to resynchronize the files after finding a mismatch. This is the default mode for comparing files, except files with the following file extensions: .exe, .com, .sys, .obj, .lib, or .bin./lb<n>Sets the number of lines for the internal line buffer to N. The default length of the line buffer is 100 lines. If the files that you are comparing have more than 100 consecutive differing lines, fc cancels the comparison./nDisplays the line numbers during an ASCII comparison./off[line]Doesn't skip files that have the offline attribute set./tPrevents fc from converting tabs to spaces. The default behavior is to treat tabs as spaces, with stops at each eighth character position./uCompares files as Unicode text files./wCompresses white space (that is, tabs and spaces) during the comparison. If a line contains many consecutive spaces or tabs, /w treats these characters as a single space. When used with /w, fc ignores white space at the beginning and end of a line./<nnnn>Specifies the number of consecutive lines that must match following a mismatch, before fc considers the files to be resynchronized. If the number of matching lines in the files is less than nnnn, fc displays the matching lines as differences. The default value is 2.[<drive1>:][<path1>]<filename1>Specifies the location and name of the first file or set of files to compare. filename1 is required.[<drive2>:][<path2>]<filename2>Specifies the location and name of the second file or set of files to compare. filename2 is required./?Displays help at the command prompt.0Files are identical.1Files are different.2An error occurred during comparison.Several platforms
Open the recent commands for editing and then run them.
Open the last command in the default system editor and run it after editing
fcIdentifySpecify an editor to open with
fc -e 'emacs'IdentifyList recent commands from history
fc -lIdentifyList recent commands in reverse order
fc -l -rIdentifyEdit and run a command from history
fc numberIdentifyEdit commands in a given interval and run them
fc '416' '420'IdentifyRun the previous command immediately without opening an editor and replace all occurrences of a string with another string
fc -s string1=string2IdentifyDisplay help
fc --helpIdentifyWindows
Compare the differences between two files or sets of files. Use wildcards (*) to compare sets of files.
Compare 2 specified files
fc path\to\file1 path\to\file2IdentifyPerform a case-insensitive comparison
fc /c path\to\file1 path\to\file2Identify/cIgnores the letter case. Windows commands referenceCompare files as Unicode text
fc /u path\to\file1 path\to\file2Identify/uCompares files as Unicode text files. Windows commands referenceCompare files as ASCII text
fc /l path\to\file1 path\to\file2Identify/lCompares the files in ASCII mode, line-by-line, and attempts to resynchronize the files after finding a mismatch. Windows commands referenceCompare files as binary
fc /b path\to\file1 path\to\file2Identify/bCompares the two files in binary mode, byte by byte, and does not attempt to resynchronize the files after finding a mismatch. Windows commands referenceDisable tab-to-space expansion
fc /t path\to\file1 path\to\file2Identify/tPrevents fc from converting tabs to spaces. Windows commands referenceCompress whitespace (tabs and spaces) for comparisons
fc /w path\to\file1 path\to\file2Identify/wCompresses white space (that is, tabs and spaces) during the comparison. Windows commands reference