{
    "content": [
        {
            "type": "text",
            "text": "# uniq (info)\n\n## Sections\n\n- **File: coreutils.info,  Node: uniq invocation,  Next: comm invocation,  Prev: shuf invocation,  Up: Operating on sorted files** (1 subsections)\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "uniq",
        "section": "",
        "mode": "info",
        "summary": null,
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "File: coreutils.info,  Node: uniq invocation,  Next: comm invocation,  Prev: shuf invocation,  Up: Operating on sorted files",
                "lines": 1,
                "subsections": [
                    {
                        "name": "7.3 'uniq': Uniquify files",
                        "lines": 144
                    }
                ]
            }
        ],
        "sections": {
            "File: coreutils.info,  Node: uniq invocation,  Next: comm invocation,  Prev: shuf invocation,  Up: Operating on sorted files": {
                "content": "",
                "subsections": [
                    {
                        "name": "7.3 'uniq': Uniquify files",
                        "content": "'uniq' writes the unique lines in the given 'input', or standard input\nif nothing is given or for an INPUT name of '-'.  Synopsis:\n\nuniq [OPTION]... [INPUT [OUTPUT]]\n\nBy default, 'uniq' prints its input lines, except that it discards\nall but the first of adjacent repeated lines, so that no output lines\nare repeated.  Optionally, it can instead discard lines that are not\nrepeated, or all repeated lines.\n\nThe input need not be sorted, but repeated input lines are detected\nonly if they are adjacent.  If you want to discard non-adjacent\nduplicate lines, perhaps you want to use 'sort -u'.  *Note sort\ninvocation::.\n\nComparisons honor the rules specified by the 'LCCOLLATE' locale\ncategory.\n\nIf no OUTPUT file is specified, 'uniq' writes to standard output.\n\nThe program accepts the following options.  Also see *note Common\noptions::.\n\n'-f N'\n'--skip-fields=N'\nSkip N fields on each line before checking for uniqueness.  Use a\nnull string for comparison if a line has fewer than N fields.\nFields are sequences of non-space non-tab characters that are\nseparated from each other by at least one space or tab.\n\nFor compatibility 'uniq' supports a traditional option syntax '-N'.\nNew scripts should use '-f N' instead.\n\n'-s N'\n'--skip-chars=N'\nSkip N characters before checking for uniqueness.  Use a null\nstring for comparison if a line has fewer than N characters.  If\nyou use both the field and character skipping options, fields are\nskipped over first.\n\nOn systems not conforming to POSIX 1003.1-2001, 'uniq' supports a\ntraditional option syntax '+N'.  Although this traditional behavior\ncan be controlled with the 'POSIX2VERSION' environment variable\n(*note Standards conformance::), portable scripts should avoid\ncommands whose behavior depends on this variable.  For example, use\n'uniq ./+10' or 'uniq -s 10' rather than the ambiguous 'uniq +10'.\n\n'-c'\n'--count'\nPrint the number of times each line occurred along with the line.\n\n'-i'\n'--ignore-case'\nIgnore differences in case when comparing lines.\n\n'-d'\n'--repeated'\nDiscard lines that are not repeated.  When used by itself, this\noption causes 'uniq' to print the first copy of each repeated line,\nand nothing else.\n\n'-D'\n'--all-repeated[=DELIMIT-METHOD]'\nDo not discard the second and subsequent repeated input lines, but\ndiscard lines that are not repeated.  This option is useful mainly\nin conjunction with other options e.g., to ignore case or to\ncompare only selected fields.  The optional DELIMIT-METHOD,\nsupported with the long form option, specifies how to delimit\ngroups of repeated lines, and must be one of the following:\n\n'none'\nDo not delimit groups of repeated lines.  This is equivalent\nto '--all-repeated' ('-D').\n\n'prepend'\nOutput a newline before each group of repeated lines.  With\n'--zero-terminated' ('-z'), use a zero byte (ASCII NUL)\ninstead of a newline as the delimiter.\n\n'separate'\nSeparate groups of repeated lines with a single newline.  This\nis the same as using 'prepend', except that no delimiter is\ninserted before the first group, and hence may be better\nsuited for output direct to users.  With '--zero-terminated'\n('-z'), use a zero byte (ASCII NUL) instead of a newline as\nthe delimiter.\n\nNote that when groups are delimited and the input stream contains\nblank lines, then the output is ambiguous.  To avoid that, filter\nthe input through 'tr -s '\\n'' to remove blank lines.\n\nThis is a GNU extension.\n\n'--group[=DELIMIT-METHOD]'\nOutput all lines, and delimit each unique group.  With\n'--zero-terminated' ('-z'), use a zero byte (ASCII NUL) instead of\na newline as the delimiter.  The optional DELIMIT-METHOD specifies\nhow to delimit groups, and must be one of the following:\n\n'separate'\nSeparate unique groups with a single delimiter.  This is the\ndefault delimiting method if none is specified, and better\nsuited for output direct to users.\n\n'prepend'\nOutput a delimiter before each group of unique items.\n\n'append'\nOutput a delimiter after each group of unique items.\n\n'both'\nOutput a delimiter around each group of unique items.\n\nNote that when groups are delimited and the input stream contains\nblank lines, then the output is ambiguous.  To avoid that, filter\nthe input through 'tr -s '\\n'' to remove blank lines.\n\nThis is a GNU extension.\n\n'-u'\n'--unique'\nDiscard the last line that would be output for a repeated input\ngroup.  When used by itself, this option causes 'uniq' to print\nunique lines, and nothing else.\n\n'-w N'\n'--check-chars=N'\nCompare at most N characters on each line (after skipping any\nspecified fields and characters).  By default the entire rest of\nthe lines are compared.\n\n'-z'\n'--zero-terminated'\nDelimit items with a zero byte rather than a newline (ASCII LF).\nI.e., treat input as items separated by ASCII NUL and terminate\noutput items with ASCII NUL. This option can be useful in\nconjunction with 'perl -0' or 'find -print0' and 'xargs -0' which\ndo the same in order to reliably handle arbitrary file names (even\nthose containing blanks or other special characters).  Note with\n'-z' the newline character is treated as a field separator.\n\nAn exit status of zero indicates success, and a nonzero value\nindicates failure.\n"
                    }
                ]
            }
        }
    }
}