Open System Services Shell and Utilities Reference Manual (G06.28+, H06.05+)

User Commands (s) split(1)
NAME
split - Splits a le into pieces of a specied size
SYNOPSIS
Current syntax
split
[-l line_count]
[-a sufx]
[le [prex] | -]
split
-b n[k | m]
[-a sufx]
[le [prex] | -]
Obsolescent syntax
split
[-number]
[-a sufx]
[le [prex] | -]
FLAGS
-a suffix Uses sufx letters to form the sufx portion of the lenames of the split les. If -a is
not specied, the default sufx length is two letters.
If the sum of the length of the prex and the sufx would create a lename exceeding
NAME_MAX - 2 bytes, an error occurs. In this case, split exits with a diagnostic mes-
sage and no les are created.
-b n[k | m]
Splits a le into pieces of the specied size. The n argument without k or m species
the size of each piece in bytes. The nk argument species the size of each piece in
n*1024 bytes. The nm argument species the size of each piece in n*1048576 bytes.
-l line_count
Species the number of lines in each output le. The line_count argument is an
unsigned decimal integer. The default value is 1000. If the input does not end with a
newline character, the partial line is included in the last output le.
-number (Obsolescent) Species the number of lines in each output le. The default value is
1000 lines per output le.
DESCRIPTION
The split command reads le and writes it in number-line pieces (the default number is 1000
lines) to a set of output les. The size of the output les can be modied by using the -b or -l
ag.
Each output le is created with a unique sufx consisting of exactly sufx lowercase letters from
the POSIX locale. The letters of the sufx are used as if they were a base-26 digit system, with
the rst sufx to be created consisting of all a characters, the second with b replacing the last a,
and so forth, until a sufx of all zs is created.
By default, the names of the output les are x, followed by a two-character sufx from the char-
acter set as described in the preceding paragraph, starting with aa, ab, ac, and so on, and continu-
ing until the sufx zz, for a maximum of 676 les.
The lename specied by prex and sufx cannot be longer than the value of NAME_MAX
minus two (from the limits.h header le).
527188-007 Hewlett-Packard Company 855