{
    "mode": "man",
    "parameter": "DIFF3",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/DIFF3/1/json",
    "generated": "2026-06-15T18:51:59Z",
    "synopsis": "diff3 [OPTION]... MYFILE OLDFILE YOURFILE",
    "sections": {
        "NAME": {
            "content": "diff3 - compare three files line by line\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "diff3 [OPTION]... MYFILE OLDFILE YOURFILE\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Compare three files line by line.\n\nMandatory arguments to long options are mandatory for short options too.\n",
            "subsections": [
                {
                    "name": "-A --show-all",
                    "content": "output all changes, bracketing conflicts\n",
                    "flag": "-A",
                    "long": "--show-all"
                },
                {
                    "name": "-e --ed",
                    "content": "output ed script incorporating changes from OLDFILE to YOURFILE into MYFILE\n",
                    "flag": "-e",
                    "long": "--ed"
                },
                {
                    "name": "-E --show-overlap",
                    "content": "like -e, but bracket conflicts\n",
                    "flag": "-E",
                    "long": "--show-overlap"
                },
                {
                    "name": "-3 --easy-only",
                    "content": "like -e, but incorporate only nonoverlapping changes\n",
                    "flag": "-3",
                    "long": "--easy-only"
                },
                {
                    "name": "-x --overlap-only",
                    "content": "like -e, but incorporate only overlapping changes\n",
                    "flag": "-x",
                    "long": "--overlap-only"
                },
                {
                    "name": "-X -x",
                    "content": "",
                    "flag": "-x"
                },
                {
                    "name": "-i",
                    "content": "",
                    "flag": "-i"
                },
                {
                    "name": "-m --merge",
                    "content": "output actual merged file, according to -A if no other options are given\n",
                    "flag": "-m",
                    "long": "--merge"
                },
                {
                    "name": "-a --text",
                    "content": "treat all files as text\n",
                    "flag": "-a",
                    "long": "--text"
                },
                {
                    "name": "--strip-trailing-cr",
                    "content": "strip trailing carriage return on input\n",
                    "long": "--strip-trailing-cr"
                },
                {
                    "name": "-T --initial-tab",
                    "content": "make tabs line up by prepending a tab\n\n--diff-program=PROGRAM\nuse PROGRAM to compare files\n",
                    "flag": "-T",
                    "long": "--initial-tab"
                },
                {
                    "name": "-L --label",
                    "content": "use LABEL instead of file name (can be repeated up to three times)\n\n--help display this help and exit\n",
                    "flag": "-L",
                    "long": "--label"
                },
                {
                    "name": "-v --version",
                    "content": "output version information and exit\n\nThe default output format is a somewhat human-readable representation of the changes.\n\nThe  -e,  -E, -x, -X (and corresponding long) options cause an ed script to be output instead\nof the default.\n\nFinally, the -m (--merge) option causes diff3 to do the merge internally and output  the  ac‐\ntual merged file.  For unusual input, this is more robust than using ed.\n\nIf  a FILE is '-', read standard input.  Exit status is 0 if successful, 1 if conflicts, 2 if\ntrouble.\n",
                    "flag": "-v",
                    "long": "--version"
                }
            ]
        },
        "AUTHOR": {
            "content": "Written by Randy Smith.\n",
            "subsections": []
        },
        "REPORTING BUGS": {
            "content": "Report bugs to: bug-diffutils@gnu.org\nGNU diffutils home page: <https://www.gnu.org/software/diffutils/>\nGeneral help using GNU software: <https://www.gnu.org/gethelp/>\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright © 2021 Free Software Foundation, Inc.  License GPLv3+: GNU GPL version 3  or  later\n<https://gnu.org/licenses/gpl.html>.\nThis  is free software: you are free to change and redistribute it.  There is NO WARRANTY, to\nthe extent permitted by law.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "cmp(1), diff(1), sdiff(1)\n\nThe full documentation for diff3 is maintained as a Texinfo manual.  If the  info  and  diff3\nprograms are properly installed at your site, the command\n\ninfo diff3\n\nshould give you access to the complete manual.\n\n\n\ndiffutils 3.8                                August 2021                                    DIFF3(1)",
            "subsections": []
        }
    },
    "summary": "diff3 - compare three files line by line",
    "flags": [
        {
            "flag": "-A",
            "long": "--show-all",
            "arg": null,
            "description": "output all changes, bracketing conflicts"
        },
        {
            "flag": "-e",
            "long": "--ed",
            "arg": null,
            "description": "output ed script incorporating changes from OLDFILE to YOURFILE into MYFILE"
        },
        {
            "flag": "-E",
            "long": "--show-overlap",
            "arg": null,
            "description": "like -e, but bracket conflicts"
        },
        {
            "flag": "-3",
            "long": "--easy-only",
            "arg": null,
            "description": "like -e, but incorporate only nonoverlapping changes"
        },
        {
            "flag": "-x",
            "long": "--overlap-only",
            "arg": null,
            "description": "like -e, but incorporate only overlapping changes"
        },
        {
            "flag": "-x",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-i",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-m",
            "long": "--merge",
            "arg": null,
            "description": "output actual merged file, according to -A if no other options are given"
        },
        {
            "flag": "-a",
            "long": "--text",
            "arg": null,
            "description": "treat all files as text"
        },
        {
            "flag": "",
            "long": "--strip-trailing-cr",
            "arg": null,
            "description": "strip trailing carriage return on input"
        },
        {
            "flag": "-T",
            "long": "--initial-tab",
            "arg": null,
            "description": "make tabs line up by prepending a tab --diff-program=PROGRAM use PROGRAM to compare files"
        },
        {
            "flag": "-L",
            "long": "--label",
            "arg": null,
            "description": "use LABEL instead of file name (can be repeated up to three times) --help display this help and exit"
        },
        {
            "flag": "-v",
            "long": "--version",
            "arg": null,
            "description": "output version information and exit The default output format is a somewhat human-readable representation of the changes. The -e, -E, -x, -X (and corresponding long) options cause an ed script to be output instead of the default. Finally, the -m (--merge) option causes diff3 to do the merge internally and output the ac‐ tual merged file. For unusual input, this is more robust than using ed. If a FILE is '-', read standard input. Exit status is 0 if successful, 1 if conflicts, 2 if trouble."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "cmp",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/cmp/1/json"
        },
        {
            "name": "diff",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/diff/1/json"
        },
        {
            "name": "sdiff",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/sdiff/1/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Compare three files line by line.",
        "examples": [
            {
                "description": "Compare files",
                "command": "diff3 {{path/to/file1}} {{path/to/file2}} {{path/to/file3}}"
            },
            {
                "description": "Show all changes, outlining conflicts",
                "command": "diff3 {{-A|--show-all}} {{path/to/file1}} {{path/to/file2}} {{path/to/file3}}"
            }
        ]
    }
}