SPLIT(1)

πŸ“¦
version 9.10 Β· 5 versions
, in ubuntu stonking

πŸ’– NAME πŸ’–

split β€” the girl who takes one file and goes "okay bestie we're dividing you" and splits it into pieces βœ‚οΈβœ¨


πŸ¦‹ SYNOPSIS πŸ¦‹

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

✨ DESCRIPTION ✨

So what she does is: she takes your FILE and she outputs pieces of it into PREFIXaa, PREFIXab, ... β€” like, literally one after the other, aa then ab then ac, iconic naming behavior πŸ’…

Default size is 1000 lines per piece, and the default PREFIX is 'x'. So yeah, if you just run her with nothing, you get xaa, xab, xac... and that's the whole vibe πŸŽ€

If you give her no FILE at all, or if FILE is -, she reads from standard input. She's flexible like that 🫢

Also important, bestie: mandatory arguments to long options are mandatory for short options too. So if a long option needs a value, the short version needs it too. No shortcuts around the shortcut, periodt.

πŸŽ€ Options πŸŽ€

  • -a, --suffix-length=N β€” generate suffixes that are length N (default is 2, as in the classic aa, ab situation)
  • --additional-suffix=SUFFIX β€” tack an extra SUFFIX onto the end of the file names. Extra seasoning πŸ“
  • -b, --bytes=SIZE β€” put SIZE bytes in each output file
  • -C, --line-bytes=SIZE β€” put at most SIZE bytes of records per output file (so she won't cut a record in half, she just caps it)
  • -d β€” use numeric suffixes starting at 0 instead of alphabetic ones. Numbers only, no letters, slay πŸ”’
  • --numeric-suffixes[=FROM] β€” same as -d, but you get to set the starting value with FROM πŸ‘‘
  • -x β€” use hex suffixes starting at 0 instead of alphabetic ones
  • --hex-suffixes[=FROM] β€” same as -x, but you get to set the starting value with FROM
  • -e, --elide-empty-files β€” don't generate empty output files when you're using '-n'. We do not keep the empty ones, they go home 🚫
  • --filter=COMMAND β€” write to the shell COMMAND instead of a file; the file name shows up as $FILE for it
  • -l, --lines=NUMBER β€” put NUMBER lines/records per output file
  • -n, --number=CHUNKS β€” generate CHUNKS output files; there's a whole explanation below, don't worry
  • -t, --separator=SEP β€” use SEP instead of a newline as the record separator; '\0' (zero) means the NUL character
  • -u, --unbuffered β€” immediately copy input to output with '-n r/...'
  • --verbose β€” print a diagnostic just before each output file is opened. She's gonna narrate, and honestly? fair πŸ“’
  • --help β€” display this help and exit
  • --version β€” output version information and exit

🧚 About that SIZE argument 🧚

The SIZE argument is an integer, and it can have an optional unit β€” for 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 work too, bestie: KiB=K, MiB=M, and so on down the line πŸ’œ

🌸 CHUNKS may be: 🌸

  1. N β€” split into N files based on size of input
  2. K/N β€” output the Kth of N to standard output
  3. l/N β€” split into N files without splitting lines/records
  4. l/K/N β€” output the Kth of N to standard output without splitting lines/records
  5. r/N β€” like 'l' but use round robin distribution (she's taking turns, very fair of her 🌈)
  6. r/K/N β€” likewise, but only output the Kth of N to standard output
Heads up: -n (except -nr) will buffer to $TMPDIR, defaulting to /tmp, if the input size cannot easily be determined. So yeah, she might stash stuff in your temp dir while she figures things out. Not a vibe killer, just so you know 😭

πŸ‘‘ AUTHOR πŸ‘‘

Written by Torbjorn Granlund and Richard M. Stallman. Legends, honestly πŸ’…


🌸 REPORTING BUGS 🌸

Found a bug? Tell the people, don't suffer in silence πŸ™ˆ


🌈 SEE ALSO 🌈

Full documentation lives at https://www.gnu.org/software/coreutils/split, or you can get it locally via:

info '(coreutils) split invocation'

Packaged by Ubuntu (9.10-1ubuntu2).

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.


okay and that's the whole page bestie β€” this is GNU coreutils 9.10, dated August 2026, and you just read SPLIT(1) in full. go forth and fragment responsibly, ily 🫢✨

πŸ“¦ where this page comes from