fir3net
PPS-Firenetbanner-780.5x190-30-03-17

Windows - Comparing 2 files

From time to time you may need to compare 2 files, i find this is useful for comparing old device configurations such as routers or firewalls to see what has changed. The program is fc (file compare). Which is a small windows program run via the Command Prompt.

This is a short guide on how to quickly see the differences using Windows DOS.

  1. Go to 'Start / run / type CMD'.
  2. Once in the Command prompt type fc
  3. Then drag both files into the window. This will save you time typing the paths and names of the files.
  4. Press enter to see the differences.

The syntax should be something like this,

fc [file1] [file2] /A

Below is an example of the output,

C:\>fc C:\file1.txt C:\file2.txt /A
Comparing files C:\file1.txt and C:\file2.txt
***** C:\file1.txt
   73:
   74:
***** C:\file2.txt
   73:
   74:  access list 101 permit ip any any
   75:

About the Author

RDonato

R Donato

Rick Donato is the Founder and Chief Editor of Fir3net.com. He currently works as a Principal Network Security Engineer and has a keen interest in automation and the cloud.

You can find Rick on Twitter @f3lix001