{
    "content": [
        {
            "type": "text",
            "text": "# split(1) (man)\n\n## TLDR\n\n> Split a file into pieces.\n\n- Split a file, each split having 10 lines (except the last split):\n  `split {{-l|--lines}} 10 {{path/to/file}}`\n- Split a file into 5 files. File is split such that each split has same size (except the last split):\n  `split {{-n|--number}} 5 {{path/to/file}}`\n- Split a file with 512 bytes in each split (except the last split; use 512k for kilobytes and 512m for megabytes):\n  `split {{-b|--bytes}} 512 {{path/to/file}}`\n- Split a file with at most 512 bytes in each split without breaking lines:\n  `split {{-C|--line-bytes}} 512 {{path/to/file}}`\n- Split into multiple files from `stdin`:\n  `gzip {{-cd|--stdout --decompress}} {{path/to/compressed_file.gz}} | split {{-l|--lines}} {{1000}} - {{path/to/output}}`\n\n*Source: tldr-pages*\n\n---\n\n**Summary:** split - split a file into pieces\n\n**Synopsis:** split [OPTION]... [FILE [PREFIX]]\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| -a | --suffix-length | — | generate suffixes of length N (default 2) --additional-suffix=SUFFIX append an additional SUFFIX to file names |\n| -b | --bytes | — | put SIZE bytes per output file |\n| -C | --line-bytes | — | put at most SIZE bytes of records per output file |\n| -d | — | — | --numeric-suffixes[=FROM] same as -d, but allow setting the start value |\n| -x | — | — | --hex-suffixes[=FROM] same as -x, but allow setting the start value |\n| -e | --elide-empty-files | — | do not generate empty output files with '-n' --filter=COMMAND write to shell COMMAND; file name is $FILE |\n| -l | --lines | — | put NUMBER lines/records per output file |\n| -n | --number | — | generate CHUNKS output files; see explanation below |\n| -t | --separator | — | use SEP instead of newline as the record separator; '\\0' (zero) specifies the NUL character |\n| -u | --unbuffered | — | immediately copy input to output with '-n r/...' |\n| — | --verbose | — | print a diagnostic just before each output file is opened --help display this help and exit |\n| — | --version | — | output version information and exit The SIZE argument is an integer and optional unit (example: 10K is 10*1024). Units a |\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (2 lines)\n- **DESCRIPTION** (7 lines) — 13 subsections\n  - -a --suffix-length (5 lines)\n  - -b --bytes (2 lines)\n  - -C --line-bytes (2 lines)\n  - -d (3 lines)\n  - -x (3 lines)\n  - -e --elide-empty-files (5 lines)\n  - -l --lines (2 lines)\n  - -n --number (2 lines)\n  - -t --separator (3 lines)\n  - -u --unbuffered (2 lines)\n  - --verbose (4 lines)\n  - --version (6 lines)\n  - CHUNKS may be: (12 lines)\n- **AUTHOR** (2 lines)\n- **REPORTING BUGS** (3 lines)\n- **COPYRIGHT** (5 lines)\n- **SEE ALSO** (6 lines)\n\n## Full Content\n\n### NAME\n\nsplit - split a file into pieces\n\n### SYNOPSIS\n\nsplit [OPTION]... [FILE [PREFIX]]\n\n### DESCRIPTION\n\nOutput  pieces  of  FILE  to PREFIXaa, PREFIXab, ...; default size is 1000 lines, and default\nPREFIX is 'x'.\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#### -a --suffix-length\n\ngenerate suffixes of length N (default 2)\n\n--additional-suffix=SUFFIX\nappend an additional SUFFIX to file names\n\n#### -b --bytes\n\nput SIZE bytes per output file\n\n#### -C --line-bytes\n\nput at most SIZE bytes of records per output file\n\n#### -d\n\n--numeric-suffixes[=FROM]\nsame as -d, but allow setting the start value\n\n#### -x\n\n--hex-suffixes[=FROM]\nsame as -x, but allow setting the start value\n\n#### -e --elide-empty-files\n\ndo not generate empty output files with '-n'\n\n--filter=COMMAND\nwrite to shell COMMAND; file name is $FILE\n\n#### -l --lines\n\nput NUMBER lines/records per output file\n\n#### -n --number\n\ngenerate CHUNKS output files; see explanation below\n\n#### -t --separator\n\nuse SEP instead of newline as the record separator;  '\\0'  (zero)  specifies  the  NUL\ncharacter\n\n#### -u --unbuffered\n\nimmediately copy input to output with '-n r/...'\n\n#### --verbose\n\nprint a diagnostic just before each output file is opened\n\n--help display this help and exit\n\n#### --version\n\noutput version information and exit\n\nThe  SIZE  argument  is  an  integer  and optional unit (example: 10K is 10*1024).  Units are\nK,M,G,T,P,E,Z,Y (powers of 1024) or KB,MB,... (powers of 1000).  Binary prefixes can be used,\ntoo: KiB=K, MiB=M, and so on.\n\n#### CHUNKS may be:\n\nN      split into N files based on size of input\n\nK/N    output Kth of N to stdout\n\nl/N    split into N files without splitting lines/records\n\nl/K/N  output Kth of N to stdout without splitting lines/records\n\nr/N    like 'l' but use round robin distribution\n\nr/K/N  likewise but only output Kth of N to stdout\n\n### AUTHOR\n\nWritten by Torbjorn Granlund and Richard M. Stallman.\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\nFull documentation <https://www.gnu.org/software/coreutils/split>\nor available locally via: info '(coreutils) split invocation'\n\n\n\nGNU coreutils 8.32                          January 2026                                    SPLIT(1)\n\n"
        }
    ],
    "structuredContent": {
        "command": "split",
        "section": "1",
        "mode": "man",
        "summary": "split - split a file into pieces",
        "synopsis": "split [OPTION]... [FILE [PREFIX]]",
        "tldr_summary": "Split a file into pieces.",
        "tldr_examples": [
            {
                "description": "Split a file, each split having 10 lines (except the last split)",
                "command": "split {{-l|--lines}} 10 {{path/to/file}}"
            },
            {
                "description": "Split a file into 5 files. File is split such that each split has same size (except the last split)",
                "command": "split {{-n|--number}} 5 {{path/to/file}}"
            },
            {
                "description": "Split a file with 512 bytes in each split (except the last split; use 512k for kilobytes and 512m for megabytes)",
                "command": "split {{-b|--bytes}} 512 {{path/to/file}}"
            },
            {
                "description": "Split a file with at most 512 bytes in each split without breaking lines",
                "command": "split {{-C|--line-bytes}} 512 {{path/to/file}}"
            },
            {
                "description": "Split into multiple files from `stdin`",
                "command": "gzip {{-cd|--stdout --decompress}} {{path/to/compressed_file.gz}} | split {{-l|--lines}} {{1000}} - {{path/to/output}}"
            }
        ],
        "tldr_source": "official",
        "flags": [
            {
                "flag": "-a",
                "long": "--suffix-length",
                "arg": null,
                "description": "generate suffixes of length N (default 2) --additional-suffix=SUFFIX append an additional SUFFIX to file names"
            },
            {
                "flag": "-b",
                "long": "--bytes",
                "arg": null,
                "description": "put SIZE bytes per output file"
            },
            {
                "flag": "-C",
                "long": "--line-bytes",
                "arg": null,
                "description": "put at most SIZE bytes of records per output file"
            },
            {
                "flag": "-d",
                "long": null,
                "arg": null,
                "description": "--numeric-suffixes[=FROM] same as -d, but allow setting the start value"
            },
            {
                "flag": "-x",
                "long": null,
                "arg": null,
                "description": "--hex-suffixes[=FROM] same as -x, but allow setting the start value"
            },
            {
                "flag": "-e",
                "long": "--elide-empty-files",
                "arg": null,
                "description": "do not generate empty output files with '-n' --filter=COMMAND write to shell COMMAND; file name is $FILE"
            },
            {
                "flag": "-l",
                "long": "--lines",
                "arg": null,
                "description": "put NUMBER lines/records per output file"
            },
            {
                "flag": "-n",
                "long": "--number",
                "arg": null,
                "description": "generate CHUNKS output files; see explanation below"
            },
            {
                "flag": "-t",
                "long": "--separator",
                "arg": null,
                "description": "use SEP instead of newline as the record separator; '\\0' (zero) specifies the NUL character"
            },
            {
                "flag": "-u",
                "long": "--unbuffered",
                "arg": null,
                "description": "immediately copy input to output with '-n r/...'"
            },
            {
                "flag": "",
                "long": "--verbose",
                "arg": null,
                "description": "print a diagnostic just before each output file is opened --help display this help and exit"
            },
            {
                "flag": "",
                "long": "--version",
                "arg": null,
                "description": "output version information and exit The SIZE argument is an integer and optional unit (example: 10K is 10*1024). Units are K,M,G,T,P,E,Z,Y (powers of 1024) or KB,MB,... (powers of 1000). Binary prefixes can be used, too: KiB=K, MiB=M, and so on."
            }
        ],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 7,
                "subsections": [
                    {
                        "name": "-a --suffix-length",
                        "lines": 5,
                        "flag": "-a",
                        "long": "--suffix-length"
                    },
                    {
                        "name": "-b --bytes",
                        "lines": 2,
                        "flag": "-b",
                        "long": "--bytes"
                    },
                    {
                        "name": "-C --line-bytes",
                        "lines": 2,
                        "flag": "-C",
                        "long": "--line-bytes"
                    },
                    {
                        "name": "-d",
                        "lines": 3,
                        "flag": "-d"
                    },
                    {
                        "name": "-x",
                        "lines": 3,
                        "flag": "-x"
                    },
                    {
                        "name": "-e --elide-empty-files",
                        "lines": 5,
                        "flag": "-e",
                        "long": "--elide-empty-files"
                    },
                    {
                        "name": "-l --lines",
                        "lines": 2,
                        "flag": "-l",
                        "long": "--lines"
                    },
                    {
                        "name": "-n --number",
                        "lines": 2,
                        "flag": "-n",
                        "long": "--number"
                    },
                    {
                        "name": "-t --separator",
                        "lines": 3,
                        "flag": "-t",
                        "long": "--separator"
                    },
                    {
                        "name": "-u --unbuffered",
                        "lines": 2,
                        "flag": "-u",
                        "long": "--unbuffered"
                    },
                    {
                        "name": "--verbose",
                        "lines": 4,
                        "long": "--verbose"
                    },
                    {
                        "name": "--version",
                        "lines": 6,
                        "long": "--version"
                    },
                    {
                        "name": "CHUNKS may be:",
                        "lines": 12
                    }
                ]
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "REPORTING BUGS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 6,
                "subsections": []
            }
        ]
    }
}