SPLIT(1)
π SPLIT(1) π
okay bestie, gather round, because split is literally the group-chat organizer of Unix β it takes one big input and cuts it into cute consecutive (or interleaved!) sections. yes, we're doing this. it's giving scissors βοΈβ¨
πΈ NAME πΈ
split β create output files containing consecutive or interleaved sections of input
β¨ SYNOPSIS β¨
split [OPTION]... [INPUT [PREFIX]]
π DESCRIPTION π
Create output files containing consecutive or interleaved sections of input. that's the whole vibe, fr fr. π
π OPTIONS π
-b,--bytes <SIZE>β put SIZE bytes per output file π-C,--line-bytes <SIZE>β put at most SIZE bytes of lines per output file (so no line gets yeeted mid-sentence)-l,--lines <NUMBER>β put NUMBER lines/records per output file [default: 1000]-n,--number <CHUNKS>β generate CHUNKS output files; the explanation is down below, keep reading bestie π--additional-suffix <SUFFIX>β additional SUFFIX to append to output file names [default: ] (yes, default is empty, she's shy)--filter <COMMAND>β write to shell COMMAND; the file name lives in$FILE(Currently not implemented for Windows β sorry Windows girlies π)-e,--elide-empty-filesβ do not generate empty output files with-n(no empty-file nonsense on our watch)-dβ use numeric suffixes starting at 0, not alphabetic--numeric-suffixes[=<FROM>]β same as-d, but allow setting the start value-xβ use hex suffixes starting at 0, not alphabetic--hex-suffixes[=<FROM>]β same as-x, but allow setting the start value-a,--suffix-length <N>β generate suffixes of length N (default 2)--verboseβ print a diagnostic just before each output file is opened (for the girlies who need the play-by-play π«Ά)-t,--separator <SEP>β use SEP instead of newline as the record separator;'\0'(zero) specifies the NUL character-h,--helpβ Print help-V,--versionβ Print version[input][default:-][prefix][default:x]
π EXTRA π
Output fixed-size pieces of INPUT to PREFIXaa, PREFIXab, ...; default size is 1000, and default PREFIX is 'x'. With no INPUT, or when INPUT is -, read standard input. main character energy: stdin counts too. π
The SIZE argument is an integer and optional unit (example: 10K is 10*1024). Units are K,M,G,T,P,E,Z,Y,R,Q (powers of 1024) or KB,MB,... (powers of 1000). Binary prefixes can be used, too: KiB=K, MiB=M, and so on. the math is mathing, don't worry π§
CHUNKS may be:
Nsplit into N files based on size of inputK/Noutput Kth of N to stdoutl/Nsplit into N files without splitting lines/recordsl/K/Noutput Kth of N to stdout without splitting lines/recordsr/Nlike'l'but use round robin distributionr/K/Nlikewise but only output Kth of N to stdout
β VERSION β
v(uutils coreutils) 0.12.0
π₯ EXAMPLES π₯
Split a file, each split having 10 lines (except the last split):
split [-l|--lines] 10 path/to/file
Split a file into 5 files. File is split such that each split has same size (except the last split):
split [-n|--number] 5 path/to/file
Split a file with 512 bytes in each split (except the last split; use 512k for kilobytes and 512m for megabytes):
split [-b|--bytes] 512 path/to/file
Split a file with at most 512 bytes in each split without breaking lines:
split [-C|--line-bytes] 512 path/to/file
Split into multiple files from stdin:
gzip [-cd|--stdout --decompress] path/to/compressed_file.gz | split [-l|--lines] 1000 - path/to/output
The examples are provided by the tldr-pages project <https://tldr.sh> under the CC BY 4.0 License. Please note that, as uutils is a work in progress, some examples might fail. π (not me warning you twice, but like, it's important)
k that's the whole page bestie, you ate. π
β¨ this was the General Commands Manual entry for split, comin' at you from the uutils coreutils fam β version v(uutils coreutils) 0.12.0, dated 2026-09-25. go forth and split responsibly, ily π«Άππ¦
π¦ where this page comes from
- ubuntu stonking: rust-coreutils 0.12.0-1ubuntu2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms