{
    "mode": "man",
    "parameter": "sdiff",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/sdiff/1/json",
    "generated": "2026-10-09T14:34:07Z",
    "synopsis": "sdiff [OPTION]... FILE1 FILE2",
    "sections": {
        "NAME": {
            "content": "sdiff - side-by-side merge of file differences\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "sdiff [OPTION]... FILE1 FILE2\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Side-by-side merge of differences between FILE1 and FILE2.\n\nMandatory arguments to long options are mandatory for short options too.\n",
            "subsections": [
                {
                    "name": "-o --output",
                    "content": "operate interactively, sending output to FILE\n",
                    "flag": "-o",
                    "long": "--output"
                },
                {
                    "name": "-i --ignore-case",
                    "content": "consider upper- and lower-case to be the same\n",
                    "flag": "-i",
                    "long": "--ignore-case"
                },
                {
                    "name": "-E --ignore-tab-expansion",
                    "content": "ignore changes due to tab expansion\n",
                    "flag": "-E",
                    "long": "--ignore-tab-expansion"
                },
                {
                    "name": "-Z --ignore-trailing-space",
                    "content": "ignore white space at line end\n",
                    "flag": "-Z",
                    "long": "--ignore-trailing-space"
                },
                {
                    "name": "-b --ignore-space-change",
                    "content": "ignore changes in the amount of white space\n",
                    "flag": "-b",
                    "long": "--ignore-space-change"
                },
                {
                    "name": "-W --ignore-all-space",
                    "content": "ignore all white space\n",
                    "flag": "-W",
                    "long": "--ignore-all-space"
                },
                {
                    "name": "-B --ignore-blank-lines",
                    "content": "ignore changes whose lines are all blank\n",
                    "flag": "-B",
                    "long": "--ignore-blank-lines"
                },
                {
                    "name": "-I --ignore-matching-lines",
                    "content": "ignore changes all whose lines match RE\n",
                    "flag": "-I",
                    "long": "--ignore-matching-lines"
                },
                {
                    "name": "--strip-trailing-cr",
                    "content": "strip trailing carriage return on input\n",
                    "long": "--strip-trailing-cr"
                },
                {
                    "name": "-a --text",
                    "content": "treat all files as text\n",
                    "flag": "-a",
                    "long": "--text"
                },
                {
                    "name": "-w --width",
                    "content": "output at most NUM (default 130) print columns\n",
                    "flag": "-w",
                    "long": "--width"
                },
                {
                    "name": "-l --left-column",
                    "content": "output only the left column of common lines\n",
                    "flag": "-l",
                    "long": "--left-column"
                },
                {
                    "name": "-s --suppress-common-lines",
                    "content": "do not output common lines\n",
                    "flag": "-s",
                    "long": "--suppress-common-lines"
                },
                {
                    "name": "-t --expand-tabs",
                    "content": "expand tabs to spaces in output\n\n--tabsize=NUM\ntab stops at every NUM (default 8) print columns\n",
                    "flag": "-t",
                    "long": "--expand-tabs"
                },
                {
                    "name": "-d --minimal",
                    "content": "try hard to find a smaller set of changes\n",
                    "flag": "-d",
                    "long": "--minimal"
                },
                {
                    "name": "-H --speed-large-files",
                    "content": "assume large files, many scattered small changes\n\n--diff-program=PROGRAM\nuse PROGRAM to compare files\n\n--help display this help and exit\n",
                    "flag": "-H",
                    "long": "--speed-large-files"
                },
                {
                    "name": "-v --version",
                    "content": "output version information and exit\n\nIf a FILE is '-', read standard input.  Exit status is 0 if inputs are the same, 1 if differ‐\nent, 2 if trouble.\n",
                    "flag": "-v",
                    "long": "--version"
                }
            ]
        },
        "AUTHOR": {
            "content": "Written by Thomas Lord.\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  ©  2023 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), diff3(1)\n\nThe  full  documentation  for sdiff is maintained as a Texinfo manual.  If the info and sdiff\nprograms are properly installed at your site, the command\n\ninfo sdiff\n\nshould give you access to the complete manual.\n\ndiffutils 3.10                                May 2023                                      SDIFF(1)",
            "subsections": []
        }
    },
    "summary": "sdiff - side-by-side merge of file differences",
    "flags": [
        {
            "flag": "-o",
            "long": "--output",
            "arg": null,
            "description": "operate interactively, sending output to FILE"
        },
        {
            "flag": "-i",
            "long": "--ignore-case",
            "arg": null,
            "description": "consider upper- and lower-case to be the same"
        },
        {
            "flag": "-E",
            "long": "--ignore-tab-expansion",
            "arg": null,
            "description": "ignore changes due to tab expansion"
        },
        {
            "flag": "-Z",
            "long": "--ignore-trailing-space",
            "arg": null,
            "description": "ignore white space at line end"
        },
        {
            "flag": "-b",
            "long": "--ignore-space-change",
            "arg": null,
            "description": "ignore changes in the amount of white space"
        },
        {
            "flag": "-W",
            "long": "--ignore-all-space",
            "arg": null,
            "description": "ignore all white space"
        },
        {
            "flag": "-B",
            "long": "--ignore-blank-lines",
            "arg": null,
            "description": "ignore changes whose lines are all blank"
        },
        {
            "flag": "-I",
            "long": "--ignore-matching-lines",
            "arg": null,
            "description": "ignore changes all whose lines match RE"
        },
        {
            "flag": "",
            "long": "--strip-trailing-cr",
            "arg": null,
            "description": "strip trailing carriage return on input"
        },
        {
            "flag": "-a",
            "long": "--text",
            "arg": null,
            "description": "treat all files as text"
        },
        {
            "flag": "-w",
            "long": "--width",
            "arg": null,
            "description": "output at most NUM (default 130) print columns"
        },
        {
            "flag": "-l",
            "long": "--left-column",
            "arg": null,
            "description": "output only the left column of common lines"
        },
        {
            "flag": "-s",
            "long": "--suppress-common-lines",
            "arg": null,
            "description": "do not output common lines"
        },
        {
            "flag": "-t",
            "long": "--expand-tabs",
            "arg": null,
            "description": "expand tabs to spaces in output --tabsize=NUM tab stops at every NUM (default 8) print columns"
        },
        {
            "flag": "-d",
            "long": "--minimal",
            "arg": null,
            "description": "try hard to find a smaller set of changes"
        },
        {
            "flag": "-H",
            "long": "--speed-large-files",
            "arg": null,
            "description": "assume large files, many scattered small changes --diff-program=PROGRAM use PROGRAM to compare files --help display this help and exit"
        },
        {
            "flag": "-v",
            "long": "--version",
            "arg": null,
            "description": "output version information and exit If a FILE is '-', read standard input. Exit status is 0 if inputs are the same, 1 if differ‐ ent, 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": "diff3",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/diff3/1/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Compare the differences between and optionally merge 2 files.",
        "examples": [
            {
                "description": "Compare 2 files",
                "command": "sdiff {{path/to/file1}} {{path/to/file2}}"
            },
            {
                "description": "Compare 2 files, ignoring all tabs and whitespace",
                "command": "sdiff {{-W|--ignore-all-space}} {{path/to/file1}} {{path/to/file2}}"
            },
            {
                "description": "Compare 2 files, ignoring whitespace at the end of lines",
                "command": "sdiff {{-Z|--ignore-trailing-space}} {{path/to/file1}} {{path/to/file2}}"
            },
            {
                "description": "Compare 2 files in a case-insensitive manner",
                "command": "sdiff {{-i|--ignore-case}} {{path/to/file1}} {{path/to/file2}}"
            },
            {
                "description": "Compare and then merge, writing the output to a new file",
                "command": "sdiff {{-o|--output}} {{path/to/merged_file}} {{path/to/file1}} {{path/to/file2}}"
            }
        ]
    }
}