{
    "content": [
        {
            "type": "text",
            "text": "# lsdiff(1) (man)\n\n**Summary:** lsdiff - show which files are modified by a patch\n\n**Synopsis:** lsdiff [[-n] | [--line-number]] [[-p n] | [--strip-match=n]] [--strip=n] [--addprefix=PREFIX]\n[[-s] | [--status]] [[-E] | [--empty-files-as-removed]] [[-i PATTERN] |\n[--include=PATTERN]] [[-x PATTERN] | [--exclude=PATTERN]] [[-z] | [--decompress]]\n[[-# RANGE] | [--hunks=RANGE]] [--lines=RANGE] [[-FRANGE] | [--files=RANGE]] [[-H] |\n[--with-filename]] [[-h] | [--no-filename]] [[-v] | [--verbose]...] [file...]\nlsdiff {[--help] | [--version] | [--filter ...] | [--grep ...]}\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| -n | --line-number | — | Display the line number that each patch begins at. If verbose output is requested (using -nv), each hunk of each patch i |\n| -N | --number-files | — | File numbers are listed, beginning at 1, before each filename. -# RANGE, --hunks=RANGE Only list hunks within the specif |\n| -F | --files | — | Only list files indicated by the specified RANGE. Files are numbered from 1 in the order they appear in the patch input, |\n| -p | — | — | When matching, ignore the first n components of the pathname. --strip=n Remove the first n components of the pathname be |\n| -s | --status | — | Show file additions, modifications and removals. A file addition is indicated by a “+”, a removal by a “-”, and a modifi |\n| -E | --empty-files-as-removed | — | Treat empty files as absent for the purpose of displaying file additions, modifications and removals. |\n| -i | — | — | Include only files matching PATTERN. |\n| -x | — | — | Exclude files matching PATTERN. |\n| -z | --decompress | — | Decompress files with extensions .gz and .bz2. |\n| -H | --with-filename | — | Print the name of the patch file containing each patch. |\n| -h | --no-filename | — | Suppress the name of the patch file containing each patch. |\n| -v | --verbose | — | Verbose output. |\n| — | --help | — | Display a short usage message. |\n| — | --version | — | Display the version number of lsdiff. |\n| — | --filter | — | Behave like filterdiff(1) instead. |\n| — | --grep | — | Behave like grepdiff(1) instead. |\n\n## Examples\n\n- `To sort the order of touched files in a patch, you can use:`\n- `lsdiff patch | sort -u | \\`\n- `xargs -rn1 filterdiff patch -i`\n- `To show only added files in a patch:`\n- `lsdiff -s patch | grep '^+' | \\`\n- `cut -c2- | xargs -rn1 filterdiff patch -i`\n- `To show the headers of all file hunks:`\n- `lsdiff -n patch | (while read n file`\n- `do sed -ne \"$n,$(($n+1))p\" patch`\n- `done)`\n\n## See Also\n\n- filterdiff(1)\n- grepdiff(1)\n- patchview(1)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (8 lines)\n- **DESCRIPTION** (4 lines)\n- **OPTIONS** (1 lines) — 16 subsections\n  - -n --line-number (13 lines)\n  - -N --number-files (15 lines)\n  - -F --files (6 lines)\n  - -p --strip-match= (8 lines)\n  - -s --status (3 lines)\n  - -E --empty-files-as-removed (3 lines)\n  - -i --include= (2 lines)\n  - -x --exclude= (2 lines)\n  - -z --decompress (2 lines)\n  - -H --with-filename (2 lines)\n  - -h --no-filename (2 lines)\n  - -v --verbose (2 lines)\n  - --help (2 lines)\n  - --version (2 lines)\n  - --filter (2 lines)\n  - --grep (2 lines)\n- **SEE ALSO** (2 lines)\n- **EXAMPLES** (16 lines)\n- **AUTHOR** (6 lines)\n\n## Full Content\n\n### NAME\n\nlsdiff - show which files are modified by a patch\n\n### SYNOPSIS\n\nlsdiff [[-n] | [--line-number]] [[-p n] | [--strip-match=n]] [--strip=n] [--addprefix=PREFIX]\n[[-s] | [--status]] [[-E] | [--empty-files-as-removed]] [[-i PATTERN] |\n[--include=PATTERN]] [[-x PATTERN] | [--exclude=PATTERN]] [[-z] | [--decompress]]\n[[-# RANGE] | [--hunks=RANGE]] [--lines=RANGE] [[-FRANGE] | [--files=RANGE]] [[-H] |\n[--with-filename]] [[-h] | [--no-filename]] [[-v] | [--verbose]...] [file...]\n\nlsdiff {[--help] | [--version] | [--filter ...] | [--grep ...]}\n\n### DESCRIPTION\n\nList the files modified by a patch.\n\nYou can use both unified and context format diffs with this program.\n\n### OPTIONS\n\n#### -n --line-number\n\nDisplay the line number that each patch begins at. If verbose output is requested (using\n-nv), each hunk of each patch is listed as well.\n\nFor each file that is modified, a line is generated containing the line number of the\nbeginning of the patch, followed by a Tab character, followed by the name of the file\nthat is modified. If -v is given once, following each of these lines will be one line for\neach hunk, consisting of a Tab character, the line number that the hunk begins at,\nanother Tab character, the string “Hunk #”, and the hunk number (starting at 1).\n\nIf the -v is given twice in conjunction with -n (i.e.  -nvv), the format is slightly\ndifferent: hunk-level descriptive text is shown after each hunk number, and the\n--number-files option is enabled.\n\n#### -N --number-files\n\nFile numbers are listed, beginning at 1, before each filename.\n\n-# RANGE, --hunks=RANGE\nOnly list hunks within the specified RANGE. Hunks are numbered from 1, and the range is a\ncomma-separated list of numbers or “first-last” spans, optionally preceded by a modifier\n'x' which inverts the entire range; either the first or the last in the span may be\nomitted to indicate no limit in that direction.\n\n--lines=RANGE\nOnly list hunks that contain lines from the original file that lie within the specified\nRANGE. Lines are numbered from 1, and the range is a comma-separated list of numbers or\n“first-last” spans, optionally preceded by a modifier 'x' which inverts the entire range;\neither the first or the last in the span may be omitted to indicate no limit in that\ndirection.\n\n#### -F --files\n\nOnly list files indicated by the specified RANGE. Files are numbered from 1 in the order\nthey appear in the patch input, and the range is a comma-separated list of numbers or\n“first-last” spans, optionally preceded by a modifier 'x' which inverts the entire range;\neither the first or the last in the span may be omitted to indicate no limit in that\ndirection.\n\n#### -p --strip-match=\n\nWhen matching, ignore the first n components of the pathname.\n\n--strip=n\nRemove the first n components of the pathname before displaying it.\n\n--addprefix=PREFIX\nPrefix the pathname with PREFIX before displaying it.\n\n#### -s --status\n\nShow file additions, modifications and removals. A file addition is indicated by a “+”, a\nremoval by a “-”, and a modification by a “!”.\n\n#### -E --empty-files-as-removed\n\nTreat empty files as absent for the purpose of displaying file additions, modifications\nand removals.\n\n#### -i --include=\n\nInclude only files matching PATTERN.\n\n#### -x --exclude=\n\nExclude files matching PATTERN.\n\n#### -z --decompress\n\nDecompress files with extensions .gz and .bz2.\n\n#### -H --with-filename\n\nPrint the name of the patch file containing each patch.\n\n#### -h --no-filename\n\nSuppress the name of the patch file containing each patch.\n\n#### -v --verbose\n\nVerbose output.\n\n#### --help\n\nDisplay a short usage message.\n\n#### --version\n\nDisplay the version number of lsdiff.\n\n#### --filter\n\nBehave like filterdiff(1) instead.\n\n#### --grep\n\nBehave like grepdiff(1) instead.\n\n### SEE ALSO\n\nfilterdiff(1), grepdiff(1), patchview(1)\n\n### EXAMPLES\n\nTo sort the order of touched files in a patch, you can use:\n\nlsdiff patch | sort -u | \\\nxargs -rn1 filterdiff patch -i\n\nTo show only added files in a patch:\n\nlsdiff -s patch | grep '^+' | \\\ncut -c2- | xargs -rn1 filterdiff patch -i\n\nTo show the headers of all file hunks:\n\nlsdiff -n patch | (while read n file\ndo sed -ne \"$n,$(($n+1))p\" patch\ndone)\n\n### AUTHOR\n\nTim Waugh <twaugh@redhat.com>\nPackage maintainer\n\n\n\npatchutils                                   23 Jan 2009                                   LSDIFF(1)\n\n"
        }
    ],
    "structuredContent": {
        "command": "lsdiff",
        "section": "1",
        "mode": "man",
        "summary": "lsdiff - show which files are modified by a patch",
        "synopsis": "lsdiff [[-n] | [--line-number]] [[-p n] | [--strip-match=n]] [--strip=n] [--addprefix=PREFIX]\n[[-s] | [--status]] [[-E] | [--empty-files-as-removed]] [[-i PATTERN] |\n[--include=PATTERN]] [[-x PATTERN] | [--exclude=PATTERN]] [[-z] | [--decompress]]\n[[-# RANGE] | [--hunks=RANGE]] [--lines=RANGE] [[-FRANGE] | [--files=RANGE]] [[-H] |\n[--with-filename]] [[-h] | [--no-filename]] [[-v] | [--verbose]...] [file...]\nlsdiff {[--help] | [--version] | [--filter ...] | [--grep ...]}",
        "flags": [
            {
                "flag": "-n",
                "long": "--line-number",
                "arg": null,
                "description": "Display the line number that each patch begins at. If verbose output is requested (using -nv), each hunk of each patch is listed as well. For each file that is modified, a line is generated containing the line number of the beginning of the patch, followed by a Tab character, followed by the name of the file that is modified. If -v is given once, following each of these lines will be one line for each hunk, consisting of a Tab character, the line number that the hunk begins at, another Tab character, the string “Hunk #”, and the hunk number (starting at 1). If the -v is given twice in conjunction with -n (i.e. -nvv), the format is slightly different: hunk-level descriptive text is shown after each hunk number, and the --number-files option is enabled."
            },
            {
                "flag": "-N",
                "long": "--number-files",
                "arg": null,
                "description": "File numbers are listed, beginning at 1, before each filename. -# RANGE, --hunks=RANGE Only list hunks within the specified RANGE. Hunks are numbered from 1, and the range is a comma-separated list of numbers or “first-last” spans, optionally preceded by a modifier 'x' which inverts the entire range; either the first or the last in the span may be omitted to indicate no limit in that direction. --lines=RANGE Only list hunks that contain lines from the original file that lie within the specified RANGE. Lines are numbered from 1, and the range is a comma-separated list of numbers or “first-last” spans, optionally preceded by a modifier 'x' which inverts the entire range; either the first or the last in the span may be omitted to indicate no limit in that direction."
            },
            {
                "flag": "-F",
                "long": "--files",
                "arg": null,
                "description": "Only list files indicated by the specified RANGE. Files are numbered from 1 in the order they appear in the patch input, and the range is a comma-separated list of numbers or “first-last” spans, optionally preceded by a modifier 'x' which inverts the entire range; either the first or the last in the span may be omitted to indicate no limit in that direction."
            },
            {
                "flag": "-p",
                "long": null,
                "arg": null,
                "description": "When matching, ignore the first n components of the pathname. --strip=n Remove the first n components of the pathname before displaying it. --addprefix=PREFIX Prefix the pathname with PREFIX before displaying it."
            },
            {
                "flag": "-s",
                "long": "--status",
                "arg": null,
                "description": "Show file additions, modifications and removals. A file addition is indicated by a “+”, a removal by a “-”, and a modification by a “!”."
            },
            {
                "flag": "-E",
                "long": "--empty-files-as-removed",
                "arg": null,
                "description": "Treat empty files as absent for the purpose of displaying file additions, modifications and removals."
            },
            {
                "flag": "-i",
                "long": null,
                "arg": null,
                "description": "Include only files matching PATTERN."
            },
            {
                "flag": "-x",
                "long": null,
                "arg": null,
                "description": "Exclude files matching PATTERN."
            },
            {
                "flag": "-z",
                "long": "--decompress",
                "arg": null,
                "description": "Decompress files with extensions .gz and .bz2."
            },
            {
                "flag": "-H",
                "long": "--with-filename",
                "arg": null,
                "description": "Print the name of the patch file containing each patch."
            },
            {
                "flag": "-h",
                "long": "--no-filename",
                "arg": null,
                "description": "Suppress the name of the patch file containing each patch."
            },
            {
                "flag": "-v",
                "long": "--verbose",
                "arg": null,
                "description": "Verbose output."
            },
            {
                "flag": "",
                "long": "--help",
                "arg": null,
                "description": "Display a short usage message."
            },
            {
                "flag": "",
                "long": "--version",
                "arg": null,
                "description": "Display the version number of lsdiff."
            },
            {
                "flag": "",
                "long": "--filter",
                "arg": null,
                "description": "Behave like filterdiff(1) instead."
            },
            {
                "flag": "",
                "long": "--grep",
                "arg": null,
                "description": "Behave like grepdiff(1) instead."
            }
        ],
        "examples": [
            "To sort the order of touched files in a patch, you can use:",
            "lsdiff patch | sort -u | \\",
            "xargs -rn1 filterdiff patch -i",
            "To show only added files in a patch:",
            "lsdiff -s patch | grep '^+' | \\",
            "cut -c2- | xargs -rn1 filterdiff patch -i",
            "To show the headers of all file hunks:",
            "lsdiff -n patch | (while read n file",
            "do sed -ne \"$n,$(($n+1))p\" patch",
            "done)"
        ],
        "see_also": [
            {
                "name": "filterdiff",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/filterdiff/1/json"
            },
            {
                "name": "grepdiff",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/grepdiff/1/json"
            },
            {
                "name": "patchview",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/patchview/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-n --line-number",
                        "lines": 13,
                        "flag": "-n",
                        "long": "--line-number"
                    },
                    {
                        "name": "-N --number-files",
                        "lines": 15,
                        "flag": "-N",
                        "long": "--number-files"
                    },
                    {
                        "name": "-F --files",
                        "lines": 6,
                        "flag": "-F",
                        "long": "--files"
                    },
                    {
                        "name": "-p --strip-match=",
                        "lines": 8,
                        "flag": "-p"
                    },
                    {
                        "name": "-s --status",
                        "lines": 3,
                        "flag": "-s",
                        "long": "--status"
                    },
                    {
                        "name": "-E --empty-files-as-removed",
                        "lines": 3,
                        "flag": "-E",
                        "long": "--empty-files-as-removed"
                    },
                    {
                        "name": "-i --include=",
                        "lines": 2,
                        "flag": "-i"
                    },
                    {
                        "name": "-x --exclude=",
                        "lines": 2,
                        "flag": "-x"
                    },
                    {
                        "name": "-z --decompress",
                        "lines": 2,
                        "flag": "-z",
                        "long": "--decompress"
                    },
                    {
                        "name": "-H --with-filename",
                        "lines": 2,
                        "flag": "-H",
                        "long": "--with-filename"
                    },
                    {
                        "name": "-h --no-filename",
                        "lines": 2,
                        "flag": "-h",
                        "long": "--no-filename"
                    },
                    {
                        "name": "-v --verbose",
                        "lines": 2,
                        "flag": "-v",
                        "long": "--verbose"
                    },
                    {
                        "name": "--help",
                        "lines": 2,
                        "long": "--help"
                    },
                    {
                        "name": "--version",
                        "lines": 2,
                        "long": "--version"
                    },
                    {
                        "name": "--filter",
                        "lines": 2,
                        "long": "--filter"
                    },
                    {
                        "name": "--grep",
                        "lines": 2,
                        "long": "--grep"
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 16,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 6,
                "subsections": []
            }
        ]
    }
}