Open System Services Shell and Utilities Reference Manual (G06.29+, H06.08+, J06.03+)
split(1) OSS Shell and Utilities Reference Manual
NAME
split - Splits a file into pieces of a specified size
SYNOPSIS
Current syntax
split
[-l line_count]
[-a suffix]
[file [prefix] | -]
split
-b n[k | m]
[-a suffix]
[file [prefix] | -]
Obsolescent syntax
split
[-number]
[-a suffix]
[file [prefix] | -]
FLAGS
-a suffix Uses suffix letters to form the suffix portion of the filenames of the split files. If -a is
not specified, the default suffix length is two letters.
If the sum of the length of the prefix and the suffix would create a filename exceeding
NAME_MAX - 2 bytes, an error occurs. In this case, split exits with a diagnostic mes-
sage and no files are created.
-b n[k | m]
Splits a file into pieces of the specified size. The n argument without k or m specifies
the size of each piece in bytes. The nk argument specifies the size of each piece in
n*1024 bytes. The nm argument specifies the size of each piece in n *1048576 bytes.
-l line_count
Specifies the number of lines in each output file. 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 file.
-number (Obsolescent) Specifies the number of lines in each output file. The default value is
1000 lines per output file.
DESCRIPTION
The split command reads file and writes it in number-line pieces (the default number is 1000
lines) to a set of output files. The size of the output files can be modified by using the -b or -l
flag.
Each output file is created with a unique suffix consisting of exactly suffix lowercase letters from
the POSIX locale. The letters of the suffix are used as if they were a base-26 digit system, with
the first suffix to be created consisting of all a characters, the second with b replacing the last a,
and so forth, until a suffix of all zs is created.
By default, the names of the output files are x, followed by a two-character suffix from the char-
acter set as described in the preceding paragraph, starting with aa, ab, ac, and so on, and continu-
ing until the suffix zz, for a maximum of 676 files.
The filename specified by prefix and suffix cannot be longer than the value of NAME_MAX
minus two (from the limits.h header file).
8−58 Hewlett-Packard Company 527188-021