CMD Master
Back to Blog
Arnošt Havelka

Fc Command

Compare files and find differences instantly.

Start Interactive Lesson
Fc Command

Fc Command

The fc (File Compare) command is a built-in Windows utility that compares two individual files or sets of files and displays the differences between them. It is an essential tool for developers and system administrators to verify file integrity, check for changes in configuration files, or debug code discrepancies.

Usage:fc
[options]
[drive1:][path1]filename1
[drive2:][path2]filename2
/b
Performs a binary comparison.
/c
Ignores the case of letters.
/n
Displays the line numbers on an ASCII comparison.
/w
Compresses white space (tabs and spaces) for comparison.

Common Options

Real-World Examples

1. Basic Text Comparison

Compare two simple text files to see if lines have been added, removed, or changed.

Command Prompt
C:\Users\User>fc file1.txt file2.txt

2. Comparing Configuration Files with Line Numbers

When updating software, you often need to check what changed in the configuration. Using /n helps find the exact line.

Command Prompt
C:\Users\User>fc /n config_v1.ini config_v2.ini

3. Ignoring Case and Whitespace

Sometimes formatting changes or capitalization shouldn't count as a difference. Use /c and /w.

Command Prompt
C:\Users\User>fc /c /w draft.txt final.txt

Knowledge Check

1 / 3

Which switch allows you to see line numbers in the output?

Up Next

Copy Con Command

Create simple text files directly from the command line.