{
    "mode": "man",
    "parameter": "head",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/head/1/json",
    "generated": "2026-06-03T03:32:47Z",
    "synopsis": "head [OPTION]... [FILE]...",
    "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": []
        }
    },
    "summary": "head - output the first part of files",
    "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"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Output the first part of files.",
        "examples": [
            {
                "description": "Output the first few lines of a file",
                "command": "head -n {{count}} {{path/to/file}}"
            }
        ]
    }
}