Windows: The fc command

I recently stumbled upon the fc.exe (“file compare”) utility on Windows, when I needed to quickly compare two text files.

Initially, I wanted to use Powershell’s Compare-Object cmdlet again for that, but my task at that time was very simple (it came down to “just show me the lines that differ in both files and display them close by to each other…”), and since I still struggle a bit with Compare-Object, because I rarely use on the command line, I (finally) learned about fc.exe… 😄

Thus, the job was swiftly done by supplying the names of the two files which I wanted to compare, and then redirecting the result to a third file that I could inspect at rest:

fc.exe FileA.txt FileB.txt > diff.txt

For more elaborate explanations of the program’s options and parameters, see these pages:

A propos Powershell:
If you plan to call the program from within a Powershell terminal, make sure to call it with the EXE-extension; i.e. fc.exe, because a simple fc from a Powershell prompt will invoke Powershell’s own fc, which is an alias for Format-Custom