diff3
Quick Reference
Command Name:
diff3
Category:
file management
Platform:
Linux/Unix
Basic Usage:
Common Use Cases
- 1
Three-way file comparison
Compare three files to identify differences and common elements
- 2
Conflict resolution
Resolve merge conflicts when two people modify the same file
- 3
File merging
Merge changes from multiple sources into a single file
- 4
Version control
Compare original, modified, and third-party versions of a file
Syntax
diff3 [OPTION]... MYFILE OLDFILE YOURFILE
Options
| Option | Description |
|---|---|
-A, --show-all |
Show all changes, bracketing conflicts |
-e, --ed |
Output an ed script to incorporate all changes |
-E, --show-overlap |
Show conflicts with simpler bracketing |
-m, --merge |
Output merged file with conflicts bracketed |
-x, --overlap-only |
Show only overlapping changes |
-3, --easy-only |
Show only non-overlapping changes |
-L, --label=LABEL |
Use LABEL instead of filename in output headers |
-T, --initial-tab |
Line up tabs properly in output |
--help |
Display help information |
--version |
Display version information |
Examples
How to Use These Examples
The examples below show common ways to use the diff3 command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.