Software-OK
≡... News | ... Home | ... FAQ | Impressum | Contact | Listed at | Thank you |

  
HOME ► Faq ► FAQ - Windows cmd.exe Command-Prompt ► ««« »»»

Find file comparisons and identical files via the cmd.exe command line!


Via the MS Windows OS command prompt, you can also find file comparisons and identical files via the cmd.exe command line!




There are great third-party tools or no-frills tools that can find the same images , however, it is the command prompt that lets you compare files to see if there are any differences in content ( binary code ) that you can access when you are using a PC. The file comparison (File Compare or FC) is a simple program that compares the content of text or binary files and can compare both ASCII and Unicode text  .


You can use the FC tool to display lines from two files or two groups of files that do not match the others. Long speech ... here are short examples!

Contents:

1.) ... Compare two text files with data comparison FC!
2.) ... Compare files in a Windows folder!
3.) ... Compare whether two files are identical.
4.) ... Comparison of two files in binary mode
5.) ... FC parameters / options for the file comparison!


1.) Compare two text files with data comparison FC!

In this case, the entire text of the documents is compared, if they do not match correctly, this is also output / displayed. 

If they are identical, "FC: No differences found" appears.

The output:


C:\> fc C:\Test\File1.txt C:\Test\File2.txt
Compare the files C:\TEST\File1.txt and C:\TEST\FILE2.TXT
FC: No differences found


C:\> fc C:\Test\File1.txt C:\Test\File2.txt
Compare the files C:\TEST\File1.txt and C:\TEST\FILE2.TXT
***** C:\TEST\File1.txt
Test 2
Test 3
***** C:\TEST\FILE2.TXT
Test 2
Test 4

*****

C:\>


You see with the command prompt window you can compare your text files on the Windows computer quite easily, a very simple file comparison. Remember to correctly enter the path name that corresponds to the files to be compared on your computer and that the prompt is not case-sensitive, which is very different with Linux.

2.) Compare files in a Windows folder!

To do this job, you should use Powershell: 

.... Windows PowerShell: How to find Duplicate Files!



(Image-2) File comparisons and find identical files via PowerShell!
File comparisons and find identical files via PowerShell!


Info:

Anyone who manages a file store must keep track of the size of the files to ensure that there is always enough free space. Documents, photos, backups, and others can quickly consume your shared file resources - especially if you have a lot of duplicates. Duplicate files are often the result of user errors, such as: B. Double copy actions or incorrect folder transfers. To avoid wasted space and storage costs, you need to analyze your file structure, find duplicate files and remove them. You can do this tedious task faster with a simple Windows PowerShell script. Just run the code given above, providing the path to the folders you are interested in.



-
▲ Back to the top ▲


3.) Compare whether two files are identical.

identical to point-1 or point-4  !

Can also be started via PowerShell without any problems, 
just enter cmd and then use "FC" to compare files!

(Image-3) File comparisons via command line via PowerShell!
File comparisons via command line via PowerShell!

-
▲ Back to the top ▲


4.) Comparison of two files in binary mode 

Identical to example 1 , only with the additional parameter "/ b". 

To explain the output:
 
So the character 21 (Hex 0x15) is not identical in file 1, it is 0x33 and in file 2 0x34, but can also be easily recognized im ( ... see Image-1 ) The output is in the  hexadecimal number system !



(Image-1) File comparisons for identical content via the cmd.exe command line!
File comparisons for identical content via the cmd.exe command line!

When comparing two files that are not identical, FC indicates that there is a difference between the two files. Now that you know the basics of the FC tool, it's time to play with the switches and try some new ideas. Remember that when playing with files, it is best to experiment with simple examples like the ones presented here to avoid accidental data loss as well.
-
▲ Back to the top ▲


5.) FC parameters / options for the file comparison!

Here is the output of the possible parameters (program arguments)



F: \ _ cpp_m \ _2019 \ ColorConsole \ ColorConsole \ bin> FC /?

Compares two files or two sets of files and shows the
differences between them.


FC [/ A] [/ C] [/ L] [/ LBn] [/ N] [/ OFF [LINE]] [/ T] [/ U] [/ W] [/ nnnn]
[ drive1 :] [path1 ] Filename1 [drive2:] [path2] filename2
FC / B [drive1:] [path1] filename1 [drive2:] [path2] filename2

/A Displays only the first and last lines of each set of
differences.
/B Performs a binary comparison.
/C Compares regardless of case.
/L Compares files as ASCII text files.
/LBn Represents the maximum number of consecutive, different
Lines to the specified number n.
/N Displays the line numbers for an ASCII comparison.
/OFF[LINE] Does not skip offline files.
/T Does not expand tab characters to spaces.
/U Compares files as UNICODE text files.
/W Compresses tabs and spaces for the comparison process.
/nnnn Number of consecutive lines that
must match again after a difference .

[Drive1:] [Path1] Filename1
Specifies the first file or first set of files to be compared.
[Drive2:] [path2] filename2
Specifies the second file or second set of files for comparison.

F: \ _ cpp_m \ _2019 \ ColorConsole \ ColorConsole \ bin>













FAQ 65: Updated on: 23 June 2022 08:48 Windows
Windows-Console

Query installed Windows versions with PowerShell and command prompt!


You can query the installed Windows versions with PowerShell or a command prompt without much effort Everyone knows how to find out the Windows version
Windows-Console

Fastest way to open a command prompt in the directory you want!


Here is the fastest way to open a command prompt in the desired directory in Microsoft File Explorer Once you are more comfortable with the Command Prompt,
Windows-Console

FTP uploads / downloads via the command prompt in Windows 11, 10, 8.1, ...!


Its easy to do auto FTP uploads from the Windows Command Prompt in MS Windows 11, 10, 8.1, Desktop or Microsoft Server OS 1. Establish a connection
Windows-Console

Access Google Services from the command prompt using command lines!


Want to show your page and access your Google Docs, Sheets, Services from the command prompt via command lines GoogleCL is a Python command line application
Windows-Console

Watch Star Wars Episode IV from Command Prompt!


Exactly, you can just watch Star Wars Episode IV from the command prompt Info: Yes, you read that right. You can watch an ASCII version of the full Star
Windows-Console

Keyboard shortcuts for the command prompt under Windows 11, 10, 8.1, ...!


The CMD.EXE key combinations for the command prompt under Windows 11, 10, 8.1, and MS Server 2022, 2019, 2016, Contents: 1. The standard keyboard
Windows-Console

Command line to delete the temporary files on Windows drives!


With the command prompt it is easy to delete the temporary files on Windows 11, 10, drives with a command Anyone who knows Windows drive cleaning and

»»

  My question is not there in the FAQ
Asked questions on this answer:
Keywords: windows, console, find, file, comparisons, identical, files, command, line, prompt, great, tools, Questions, Answers, Software




    

  + Freeware
  + Order on the PC
  + File management
  + Automation
  + Office Tools
  + PC testing tools
  + Decoration and fun
  + Desktop-Clocks

  + SoftwareOK Pages
  + Micro Staff
  + Freeware-1
  + Freeware-2
  + Freeware-3
  + FAQ
  + Downloads

  + Top
  + Desktop-OK
  + The Quad Explorer
  + Don't Sleep
  + Win-Scan-2-PDF
  + Quick-Text-Past
  + Print Folder Tree
  + Find Same Images
  + Experience-Index-OK
  + Font-View-OK


  + Freeware
  + TraceRouteOK
  + GetWindowText
  + AutoHideMouseCursor
  + Desktop.Calendar.Tray.OK
  + OK.Its.Raining.Men
  + Run-Command
  + MagicMouseTrails
  + CpuFrequenz
  + MultiClipBoardSlots
  + PAD-s


Home | Thanks | Contact | Link me | FAQ | Windows 2021 | Windows 10 | English-AV | Impressum | Translate | PayPal | PAD-s

 © 2023 by Nenad Hrg softwareok.de • softwareok.com • softwareok.com • softwareok.eu
0.061


► Where can I see the version of the driver on all MS Windows OS? ◄

► How to show filename extension in Windows-10? ◄

► Change the workgroup / PC name using the command prompt or PowerShell! ◄

This website uses cookies to ensure you get the best experience on our website more Infos & Privacy Policy
....