TrumanWong

diff3

Compare the differences between 3 files

Supplementary instructions

diff3 command is used to compare three files and display the differences between the three files to the standard output.

grammar

diff3(options)(parameters)

Options

-a: treat all files as text files and compare them in behavioral units, that is, the given file is not a text file;
-A: Merge the differences between the second file and the third file into the first file. Conflicts are enclosed in parentheses;
-B: Same function as option "-A", but does not display conflicting content;
-e/--ed: Generate a "-ed" script to merge the differences between the 2nd file and the 3rd file into the 1st file;
--easy-only: Same function as option "-e" except not showing overlapping changes;
-i: In order to be compatible with the system V system, the "w" and "q" commands are generated at the end of the "ed" script. This option must be used with the option "-AeExX3", but cannot be used with "-m";
--initial-tab: Output a TAB character instead of two whitespace characters before text in a normally formatted line. This option will cause the alignment of TAB characters in the line to look normal.

Parameters

  • File 1: Specify the first file to be compared;
  • File 2: Specify the second file to be compared;
  • File 3: Specify the third file to be compared.