CmdID

CmdID / Commands

fc

Compares two files or sets of files and displays the differences between them. Windows commands reference

On Windows File fc.exe

Opens CmdID with your command. It is read in your browser and sent nowhere.

Windows

from the Windows commands reference, CC BY 4.0
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.rpt
fc /b profits.bat earnings.bat
00000002: 72 43
00000004: 65 3A
0000000E: 56 92
000005E8: 00 6E
FC: earnings.bat longer than profits.bat
Comparing files profits.bat and earnings.bat
FC: no differences encountered
fc *.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

from tldr-pages, CC BY 4.0

Open the recent commands for editing and then run them.

Open the last command in the default system editor and run it after editing

Specify an editor to open with

fc -e 'emacs'Identify

List recent commands from history

List recent commands in reverse order

fc -l -rIdentify

Edit and run a command from history

fc numberIdentify

Edit commands in a given interval and run them

fc '416' '420'Identify

Run the previous command immediately without opening an editor and replace all occurrences of a string with another string

fc -s string1=string2Identify

Display help

fc --helpIdentify

Windows

from tldr-pages, CC BY 4.0

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\file2Identify

Perform a case-insensitive comparison

fc /c path\to\file1 path\to\file2Identify
/cIgnores the letter case. Windows commands reference

Compare files as Unicode text

fc /u path\to\file1 path\to\file2Identify
/uCompares files as Unicode text files. Windows commands reference

Compare 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 reference

Compare 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 reference

Disable tab-to-space expansion

fc /t path\to\file1 path\to\file2Identify
/tPrevents fc from converting tabs to spaces. Windows commands reference

Compress 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