{
    "mode": "man",
    "parameter": "gdiffmk",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/gdiffmk/1/json",
    "generated": "2026-05-30T05:14:58Z",
    "synopsis": "gdiffmk [-a addmark] [-c changemark] [-d deletemark] [-D [-B] [-M mark1 mark2]] [-x diffcmd]\n[--] file1 file2 [output]",
    "sections": {
        "NAME": {
            "content": "gdiffmk - mark differences between groff/nroff/troff files\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "gdiffmk [-a addmark] [-c changemark] [-d deletemark] [-D [-B] [-M mark1 mark2]] [-x diffcmd]\n[--] file1 file2 [output]\n",
            "subsections": [
                {
                    "name": "gdiffmk --help",
                    "content": ""
                },
                {
                    "name": "gdiffmk --version",
                    "content": ""
                }
            ]
        },
        "DESCRIPTION": {
            "content": "gdiffmk compares two groff(1), nroff(1), or troff(1) documents, file1 and file2, and  creates\nan  output which is file2 with added “margin character” (.mc) commands that indicate the dif‐\nferences.\n\nIf the output filename is present, the output is written there.  If it is  -  or  absent  the\noutput is written to the standard output.\n\nIf  the file1 or file2 argument is - the standard input is read for that input.  Clearly both\ncannot be -.\n\nNote that the output is not necessarily compatible with all macro packages and all preproces‐\nsors.  See section “Bugs” below.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-a",
                    "content": "Use the addmark for source lines not in file1 but present in file2.  Default: +.\n",
                    "flag": "-a"
                },
                {
                    "name": "-B -D",
                    "content": "command, .br, to ensure that the deletions are marked properly.  This is the only  way\nto  guarantee  that  deletions and small changes get flagged.  This option directs the\nprogram not to insert these breaks; it makes no sense to use it without -D.\n",
                    "flag": "-D"
                },
                {
                    "name": "-c",
                    "content": "Use the changemark for changed source lines.  Default: |.\n",
                    "flag": "-c"
                },
                {
                    "name": "-d",
                    "content": "Use the deletemark for deleted source lines.  Default: *.\n",
                    "flag": "-d"
                },
                {
                    "name": "-D",
                    "content": "... ]].\n",
                    "flag": "-D"
                },
                {
                    "name": "-M",
                    "content": "Change  the  delimiting marks for the -D option.  It makes no sense to use this option\nwithout -D.\n",
                    "flag": "-M"
                },
                {
                    "name": "-x",
                    "content": "Use the diffcmd command to perform the comparison of file1 and file2.  In  particular,\ndiffcmd should accept the GNU diff -Dname option.  Default: diff(1).\n\n--     All the following arguments are treated as file names, even if they begin with -.\n\n--help Print a usage message on standard error output and exit.\n",
                    "flag": "-x"
                },
                {
                    "name": "--version",
                    "content": "Print version information on the standard output and exit.\n",
                    "long": "--version"
                }
            ]
        },
        "BUGS": {
            "content": "The  output  is  not necessarily compatible with all macro packages and all preprocessors.  A\nworkaround that is often successful against preprocessor problems is to run  gdiffmk  on  the\noutput of all the preprocessors instead of the input source.\n\ngdiffmk  relies  on the -Dname option of GNU diff(1) to make a merged “#ifdef” output format.\nIt hasn't been tested whether other versions of diff(1) do support this option.  See also the",
            "subsections": [
                {
                    "name": "-x",
                    "content": "",
                    "flag": "-x"
                }
            ]
        },
        "AUTHORS": {
            "content": "gdiffmk was written and is maintained by Mike Bianchi ⟨MBianchi@Foveal.com⟩.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "groff(1), nroff(1), gtroff(1), diff(1)\n\n\n\ngroff 1.22.4                                23 March 2022                                 GDIFFMK(1)",
            "subsections": []
        }
    },
    "summary": "gdiffmk - mark differences between groff/nroff/troff files",
    "flags": [
        {
            "flag": "-a",
            "long": null,
            "arg": null,
            "description": "Use the addmark for source lines not in file1 but present in file2. Default: +."
        },
        {
            "flag": "-D",
            "long": null,
            "arg": null,
            "description": "command, .br, to ensure that the deletions are marked properly. This is the only way to guarantee that deletions and small changes get flagged. This option directs the program not to insert these breaks; it makes no sense to use it without -D."
        },
        {
            "flag": "-c",
            "long": null,
            "arg": null,
            "description": "Use the changemark for changed source lines. Default: |."
        },
        {
            "flag": "-d",
            "long": null,
            "arg": null,
            "description": "Use the deletemark for deleted source lines. Default: *."
        },
        {
            "flag": "-D",
            "long": null,
            "arg": null,
            "description": "... ]]."
        },
        {
            "flag": "-M",
            "long": null,
            "arg": null,
            "description": "Change the delimiting marks for the -D option. It makes no sense to use this option without -D."
        },
        {
            "flag": "-x",
            "long": null,
            "arg": null,
            "description": "Use the diffcmd command to perform the comparison of file1 and file2. In particular, diffcmd should accept the GNU diff -Dname option. Default: diff(1). -- All the following arguments are treated as file names, even if they begin with -. --help Print a usage message on standard error output and exit."
        },
        {
            "flag": "",
            "long": "--version",
            "arg": null,
            "description": "Print version information on the standard output and exit."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "groff",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/groff/1/json"
        },
        {
            "name": "nroff",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/nroff/1/json"
        },
        {
            "name": "gtroff",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/gtroff/1/json"
        },
        {
            "name": "diff",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/diff/1/json"
        }
    ]
}