{
    "content": [
        {
            "type": "text",
            "text": "# head(1) (man)\n\n## TLDR\n\n> Output the first part of files.\n\n- Output the first few lines of a file:\n  `head -n {{count}} {{path/to/file}}`\n\n*Source: tldr-pages*\n\n---\n\n**Summary:** head - output the first part of files\n\n**Synopsis:** head [OPTION]... [FILE]...\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| -c | --bytes | — | print the first NUM bytes of each file; with the leading '-', print all but the last NUM bytes of each file |\n| -n | --lines | — | print the first NUM lines instead of the first 10; with the leading '-', print all but the last NUM lines of each file |\n| -q | --silent | — | never print headers giving file names |\n| -v | --verbose | — | always print headers giving file names |\n| -z | --zero-terminated | — | line delimiter is NUL, not newline --help display this help and exit |\n| — | --version | — | output version information and exit NUM may have a multiplier suffix: b 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024, |\n\n## See Also\n\n- tail(1)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (2 lines)\n- **DESCRIPTION** (7 lines) — 6 subsections\n  - -c --bytes (3 lines)\n  - -n --lines (3 lines)\n  - -q --quiet --silent (2 lines)\n  - -v --verbose (2 lines)\n  - -z --zero-terminated (4 lines)\n  - --version (6 lines)\n- **AUTHOR** (2 lines)\n- **REPORTING BUGS** (3 lines)\n- **COPYRIGHT** (5 lines)\n- **SEE ALSO** (8 lines)\n\n## Full Content\n\n### NAME\n\nhead - output the first part of files\n\n### SYNOPSIS\n\nhead [OPTION]... [FILE]...\n\n### DESCRIPTION\n\nPrint  the  first 10 lines of each FILE to standard output.  With more than one FILE, precede\neach with a header giving the file name.\n\nWith no FILE, or when FILE is -, read standard input.\n\nMandatory arguments to long options are mandatory for short options too.\n\n#### -c --bytes\n\nprint the first NUM bytes of each file; with the leading '-', print all but  the  last\nNUM bytes of each file\n\n#### -n --lines\n\nprint the first NUM lines instead of the first 10; with the leading '-', print all but\nthe last NUM lines of each file\n\n#### -q --quiet --silent\n\nnever print headers giving file names\n\n#### -v --verbose\n\nalways print headers giving file names\n\n#### -z --zero-terminated\n\nline delimiter is NUL, not newline\n\n--help display this help and exit\n\n#### --version\n\noutput version information and exit\n\nNUM may have a multiplier suffix: b 512, kB 1000, K  1024,  MB  1000*1000,  M  1024*1024,  GB\n1000*1000*1000,  G 1024*1024*1024, and so on for T, P, E, Z, Y.  Binary prefixes can be used,\ntoo: KiB=K, MiB=M, and so on.\n\n### AUTHOR\n\nWritten by David MacKenzie and Jim Meyering.\n\n### REPORTING BUGS\n\nGNU coreutils online help: <https://www.gnu.org/software/coreutils/>\nReport any translation bugs to <https://translationproject.org/team/>\n\n### COPYRIGHT\n\nCopyright © 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\n### SEE ALSO\n\ntail(1)\n\nFull documentation <https://www.gnu.org/software/coreutils/head>\nor available locally via: info '(coreutils) head invocation'\n\n\n\nGNU coreutils 8.32                          January 2026                                     HEAD(1)\n\n"
        }
    ],
    "structuredContent": {
        "command": "head",
        "section": "1",
        "mode": "man",
        "summary": "head - output the first part of files",
        "synopsis": "head [OPTION]... [FILE]...",
        "tldr_summary": "Output the first part of files.",
        "tldr_examples": [
            {
                "description": "Output the first few lines of a file",
                "command": "head -n {{count}} {{path/to/file}}"
            }
        ],
        "tldr_source": "official",
        "flags": [
            {
                "flag": "-c",
                "long": "--bytes",
                "arg": null,
                "description": "print the first NUM bytes of each file; with the leading '-', print all but the last NUM bytes of each file"
            },
            {
                "flag": "-n",
                "long": "--lines",
                "arg": null,
                "description": "print the first NUM lines instead of the first 10; with the leading '-', print all but the last NUM lines of each file"
            },
            {
                "flag": "-q",
                "long": "--silent",
                "arg": null,
                "description": "never print headers giving file names"
            },
            {
                "flag": "-v",
                "long": "--verbose",
                "arg": null,
                "description": "always print headers giving file names"
            },
            {
                "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 NUM may have a multiplier suffix: b 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024, GB 1000*1000*1000, G 1024*1024*1024, and so on for T, P, E, Z, Y. Binary prefixes can be used, too: KiB=K, MiB=M, and so on."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "tail",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/tail/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 7,
                "subsections": [
                    {
                        "name": "-c --bytes",
                        "lines": 3,
                        "flag": "-c",
                        "long": "--bytes"
                    },
                    {
                        "name": "-n --lines",
                        "lines": 3,
                        "flag": "-n",
                        "long": "--lines"
                    },
                    {
                        "name": "-q --quiet --silent",
                        "lines": 2,
                        "flag": "-q",
                        "long": "--silent"
                    },
                    {
                        "name": "-v --verbose",
                        "lines": 2,
                        "flag": "-v",
                        "long": "--verbose"
                    },
                    {
                        "name": "-z --zero-terminated",
                        "lines": 4,
                        "flag": "-z",
                        "long": "--zero-terminated"
                    },
                    {
                        "name": "--version",
                        "lines": 6,
                        "long": "--version"
                    }
                ]
            },
            {
                "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": "head - output the first part of files\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "head [OPTION]... [FILE]...\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Print  the  first 10 lines of each FILE to standard output.  With more than one FILE, precede\neach with a header giving the file name.\n\nWith no FILE, or when FILE is -, read standard input.\n\nMandatory arguments to long options are mandatory for short options too.\n",
                "subsections": [
                    {
                        "name": "-c --bytes",
                        "content": "print the first NUM bytes of each file; with the leading '-', print all but  the  last\nNUM bytes of each file\n",
                        "flag": "-c",
                        "long": "--bytes"
                    },
                    {
                        "name": "-n --lines",
                        "content": "print the first NUM lines instead of the first 10; with the leading '-', print all but\nthe last NUM lines of each file\n",
                        "flag": "-n",
                        "long": "--lines"
                    },
                    {
                        "name": "-q --quiet --silent",
                        "content": "never print headers giving file names\n",
                        "flag": "-q",
                        "long": "--silent"
                    },
                    {
                        "name": "-v --verbose",
                        "content": "always print headers giving file names\n",
                        "flag": "-v",
                        "long": "--verbose"
                    },
                    {
                        "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\nNUM may have a multiplier suffix: b 512, kB 1000, K  1024,  MB  1000*1000,  M  1024*1024,  GB\n1000*1000*1000,  G 1024*1024*1024, and so on for T, P, E, Z, Y.  Binary prefixes can be used,\ntoo: KiB=K, MiB=M, and so on.\n",
                        "long": "--version"
                    }
                ]
            },
            "AUTHOR": {
                "content": "Written by David MacKenzie and Jim Meyering.\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": "tail(1)\n\nFull documentation <https://www.gnu.org/software/coreutils/head>\nor available locally via: info '(coreutils) head invocation'\n\n\n\nGNU coreutils 8.32                          January 2026                                     HEAD(1)",
                "subsections": []
            }
        }
    }
}