O'Reilly logo

Windows XP in a Nutshell, Second Edition by Troy Mott, Tim O'Reilly, David A. Karp

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

File Compare (fc) — \windows\system32\fc.exe

Synopsis

Compare the contents two files (or sets of files) line by line and display the differences between them.

To Open

Command Prompt fc

Usage

fc file1 file2 [/a] [/c] [/lbn] [/n] [/t] [/w] [/offline] [/nnn] 
   [/l]
fc /b filename1 filename2

Description

File Compare (fc.exe) compares the contents of two files (or more, using wildcards) and displays the differences (if any). If the files are identical, fc.exe will report FC: no differences encountered. If the files are different, fc.exe lists the differing lines. Here’s an example of how fc.exe is used:

Start with an ordinary text file, say, Bill.txt. Open it in Notepad, change one line, and save it into a new filename, say, Marty.txt. Then open a command prompt window, make sure you’re in the same directory as the two files, and type the following:

fc bill.txt marty.txt

The output will look something like this:

Comparing files Bill.txt and Marty.txt
***** Bill.txt
Way down Louisiana close to New Orleans
Way back up in the woods among the evergreens
There stood a log cabin made of earth and wood
***** Marty.txt
Way down Louisiana close to New Orleans
Way back up in the woods among the antihistamines
There stood a log cabin made of earth and wood
*****

For each line or sequence of lines that is found to differ in the two files, fc.exe prints out a pair of excerpts from each of the files. The first and last line in each excerpt are what the two files have in common and are included for ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required