SPLIT(1)

๐Ÿ’– SPLIT(1) ๐Ÿ’–

okay bestie, welcome to the split page from the User Commands manual โ€” yes it's the one that โœจ slices your files into lil baby pieces โœจ and honestly? iconic behaviour. let's get into it ๐ŸŽ€


๐ŸŒธ NAME ๐ŸŒธ

split โ€” split a file into pieces. that's it. that's the whole job. and it ate ๐Ÿ’…


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

split [OPTION]... [FILE [PREFIX]]

โœจ DESCRIPTION โœจ

so basically: it outputs pieces of FILE to PREFIXaa, PREFIXab, ... and so on forever until your file runs out. the default size is 1000 lines, and the default PREFIX is 'x'. no cap ๐Ÿซถ

if you give it no FILE, or if FILE is -, it reads from standard input. shy king behaviour, we love it ๐Ÿ˜Œ

real talk: mandatory arguments to long options are also mandatory for the short options. that's not a vibe, that's a rule ๐Ÿ’€

๐Ÿ‘‘ OPTIONS ๐Ÿ‘‘

  • -a, --suffix-length=N โ€” generate suffixes of length N (default 2)
  • --additional-suffix=SUFFIX โ€” append an additional SUFFIX to file names
  • -b, --bytes=SIZE โ€” put SIZE bytes per output file
  • -C, --line-bytes=SIZE โ€” put at most SIZE bytes of records per output file
  • -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
  • -e, --elide-empty-files โ€” do not generate empty output files with -n
  • --filter=COMMAND โ€” write to shell COMMAND; file name is $FILE
  • -l, --lines=NUMBER โ€” put NUMBER lines/records per output file
  • -n, --number=CHUNKS โ€” generate CHUNKS output files; see explanation below ๐Ÿ‘‡
  • -t, --separator=SEP โ€” use SEP instead of newline as the record separator; '\0' (zero) specifies the NUL character
  • -u, --unbuffered โ€” immediately copy input to output with -n r/...
  • --verbose โ€” print a diagnostic just before each output file is opened
  • --help โ€” display this help and exit
  • --version โ€” output version information and exit

๐Ÿงš THE SIZE ARGUMENT ๐Ÿงš

the SIZE argument is an integer plus an optional unit (example: 10K is 10*1024). units are:

  • K, M, G, T, P, E, Z, Y, R, Q โ€” these are powers of 1024
  • KB, MB, ... โ€” these are powers of 1000

and yes, binary prefixes work too: KiB=K, MiB=M, and so on. pick your fighter, they're all valid ๐Ÿ’œ


๐Ÿ“ CHUNKS may be:

  • N โ€” split into N files based on size of input
  • K/N โ€” output Kth of N to standard output
  • l/N โ€” split into N files without splitting lines/records
  • l/K/N โ€” output Kth of N to standard output without splitting lines/records
  • r/N โ€” like 'l' but use round robin distribution
  • r/K/N โ€” likewise but only output Kth of N to standard output
โš ๏ธ heads up bestie: -n (except -nr) will buffer to $TMPDIR, defaulting to /tmp, if the input size cannot easily be determined. it's giving "i need a lil scratch space, don't perceive me" ๐Ÿ™ˆ

๐ŸŒˆ AUTHOR ๐ŸŒˆ

Written by Torbjorn Granlund and Richard M. Stallman. legends fr fr ๐Ÿ‘‘


๐Ÿ’Œ REPORTING BUGS ๐Ÿ’Œ


Copyright ยฉ 2026 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law. (yes that's the dramatic part, don't skip it ๐Ÿ˜ญ)

๐Ÿฆ„ SEE ALSO ๐Ÿฆ„


and that's the whole page, bestie!! this was GNU coreutils 9.12, dated September 2026 โ€” go forth and split responsibly ๐Ÿ’–โœจ๐ŸŽ€๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from