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:
- https://ss64.com/nt/fc.html
- https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/fc
- 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 simplefc
from a Powershell prompt will invoke Powershell’s ownfc
, which is an alias forFormat-Custom
…
Film & Television (54)
How To (63)
Journal (17)
Miscellaneous (4)
News & Announcements (21)
On Software (12)
Projects (26)