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:

  • N split into N files based on size of input
  • K/N output Kth of N to stdout
  • l/N split into N files without splitting lines/records
  • l/K/N output Kth of N to stdout without splitting lines/records
  • r/N like 'l' but use round robin distribution
  • r/K/N likewise 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