{
    "content": [
        {
            "type": "text",
            "text": "# COMM (man)\n\n## NAME\n\ncomm - compare two sorted files line by line\n\n## SYNOPSIS\n\ncomm [OPTION]... FILE1 FILE2\n\n## DESCRIPTION\n\nCompare sorted files FILE1 and FILE2 line by line.\n\n## TLDR\n\n> Select or reject lines common to two files. Both files must be sorted.\n\n- Produce three tab-separated columns: lines only in first file, lines only in second file, and common lines:\n  `comm {{file1}} {{file2}}`\n- Print only lines common to both files:\n  `comm -12 {{file1}} {{file2}}`\n- Print only lines common to both files, reading one file from `stdin`:\n  `cat {{file1}} | comm -12 - {{file2}}`\n- Get lines only found in first file, saving the result to a third file:\n  `comm -23 {{file1}} {{file2}} > {{file1_only}}`\n- Print lines only found in second file, when the files aren't sorted:\n  `comm -13 <(sort {{file1}}) <(sort {{file2}})`\n\n*Source: tldr-pages*\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (8 subsections)\n- **EXAMPLES**\n- **AUTHOR**\n- **REPORTING BUGS**\n- **COPYRIGHT**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "COMM",
        "section": "",
        "mode": "man",
        "summary": "comm - compare two sorted files line by line",
        "synopsis": "comm [OPTION]... FILE1 FILE2",
        "tldr_summary": "Select or reject lines common to two files. Both files must be sorted.",
        "tldr_examples": [
            {
                "description": "Produce three tab-separated columns: lines only in first file, lines only in second file, and common lines",
                "command": "comm {{file1}} {{file2}}"
            },
            {
                "description": "Print only lines common to both files",
                "command": "comm -12 {{file1}} {{file2}}"
            },
            {
                "description": "Print only lines common to both files, reading one file from `stdin`",
                "command": "cat {{file1}} | comm -12 - {{file2}}"
            },
            {
                "description": "Get lines only found in first file, saving the result to a third file",
                "command": "comm -23 {{file1}} {{file2}} > {{file1_only}}"
            },
            {
                "description": "Print lines only found in second file, when the files aren't sorted",
                "command": "comm -13 <(sort {{file1}}) <(sort {{file2}})"
            }
        ],
        "tldr_source": "official",
        "flags": [
            {
                "flag": "-1",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-2",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-3",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": "--check-order",
                "arg": null,
                "description": "check that the input is correctly sorted, even if all input lines are pairable"
            },
            {
                "flag": "",
                "long": "--nocheck-order",
                "arg": null,
                "description": "do not check that the input is correctly sorted --output-delimiter=STR separate columns with STR"
            },
            {
                "flag": "",
                "long": "--total",
                "arg": null,
                "description": "output a summary"
            },
            {
                "flag": "-z",
                "long": "--zero-terminated",
                "arg": null,
                "description": "line delimiter is NUL, not newline --help display this help and exit"
            },
            {
                "flag": "",
                "long": "--version",
                "arg": null,
                "description": "output version information and exit Note, comparisons honor the rules specified by 'LCCOLLATE'."
            }
        ],
        "examples": [
            "comm -12 file1 file2",
            "Print only lines present in both file1 and file2.",
            "comm -3 file1 file2",
            "Print lines in file1 not in file2, and vice versa."
        ],
        "see_also": [
            {
                "name": "join",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/join/1/json"
            },
            {
                "name": "uniq",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/uniq/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 8,
                "subsections": [
                    {
                        "name": "-1",
                        "lines": 1,
                        "flag": "-1"
                    },
                    {
                        "name": "-2",
                        "lines": 1,
                        "flag": "-2"
                    },
                    {
                        "name": "-3",
                        "lines": 1,
                        "flag": "-3"
                    },
                    {
                        "name": "--check-order",
                        "lines": 2,
                        "long": "--check-order"
                    },
                    {
                        "name": "--nocheck-order",
                        "lines": 5,
                        "long": "--nocheck-order"
                    },
                    {
                        "name": "--total",
                        "lines": 2,
                        "long": "--total"
                    },
                    {
                        "name": "-z --zero-terminated",
                        "lines": 4,
                        "flag": "-z",
                        "long": "--zero-terminated"
                    },
                    {
                        "name": "--version",
                        "lines": 4,
                        "long": "--version"
                    }
                ]
            },
            {
                "name": "EXAMPLES",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "REPORTING BUGS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 8,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "comm - compare two sorted files line by line\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "comm [OPTION]... FILE1 FILE2\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Compare sorted files FILE1 and FILE2 line by line.\n\nWhen FILE1 or FILE2 (not both) is -, read standard input.\n\nWith  no  options,  produce  three-column output.  Column one contains lines unique to FILE1,\ncolumn two contains lines unique to FILE2, and column three contains  lines  common  to  both\nfiles.\n",
                "subsections": [
                    {
                        "name": "-1",
                        "content": "",
                        "flag": "-1"
                    },
                    {
                        "name": "-2",
                        "content": "",
                        "flag": "-2"
                    },
                    {
                        "name": "-3",
                        "content": "",
                        "flag": "-3"
                    },
                    {
                        "name": "--check-order",
                        "content": "check that the input is correctly sorted, even if all input lines are pairable\n",
                        "long": "--check-order"
                    },
                    {
                        "name": "--nocheck-order",
                        "content": "do not check that the input is correctly sorted\n\n--output-delimiter=STR\nseparate columns with STR\n",
                        "long": "--nocheck-order"
                    },
                    {
                        "name": "--total",
                        "content": "output a summary\n",
                        "long": "--total"
                    },
                    {
                        "name": "-z --zero-terminated",
                        "content": "line delimiter is NUL, not newline\n\n--help display this help and exit\n",
                        "flag": "-z",
                        "long": "--zero-terminated"
                    },
                    {
                        "name": "--version",
                        "content": "output version information and exit\n\nNote, comparisons honor the rules specified by 'LCCOLLATE'.\n",
                        "long": "--version"
                    }
                ]
            },
            "EXAMPLES": {
                "content": "comm -12 file1 file2\nPrint only lines present in both file1 and file2.\n\ncomm -3 file1 file2\nPrint lines in file1 not in file2, and vice versa.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Written by Richard M. Stallman and David MacKenzie.\n",
                "subsections": []
            },
            "REPORTING BUGS": {
                "content": "GNU coreutils online help: <https://www.gnu.org/software/coreutils/>\nReport any translation bugs to <https://translationproject.org/team/>\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "Copyright  ©  2020 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": "join(1), uniq(1)\n\nFull documentation <https://www.gnu.org/software/coreutils/comm>\nor available locally via: info '(coreutils) comm invocation'\n\n\n\nGNU coreutils 8.32                          January 2026                                     COMM(1)",
                "subsections": []
            }
        }
    }
}