maux
Star on GitHub Buy me a coffee

Manual / split

split(1)

SPLIT(1) General Commands Manual SPLIT(1)

split - split a file into pieces

split [ -l n | -b n[k|m] ] [ -a suffix_length ] [ file [ name ]]

Split reads file (standard input if it is absent or -) and writes it out in pieces, each a separate file named name (default x) followed by a generated suffix of suffix_length letters (-a, default 2): aa, ab, and so on. The default is -l 1000 (1000 lines per piece). -b n splits by raw byte count instead; a piece boundary may fall in the middle of a line, and the bytes on either side of it are copied verbatim. n may be suffixed k (1024) or m (1,048,576, KNOWN LIMITATION: the result silently wraps modulo 65536 on this 16-bit machine).

A source whose length divides evenly by the split unit never leaves a trailing empty piece; an empty source still gets exactly one empty piece. If name plus suffix_length would exceed ProDOS's own 15-character filename limit, or more pieces are needed than suffix_length letters can name, the run stops with a diagnostic and exit 1 -- every piece already written stays.

/usr/man/SPLIT this page

Exit status is 0 on success; 1 if the input file could not be opened, the name/suffix length exceeds 15 characters, an output piece could not be created or written, or the suffix letters are exhausted; 2 on a usage error.

None known.

September 15, 2026 maux