SPLIT(1)

NAME
split - split a file into pieces

SYNOPSIS
split [-b byte_count[k|m]] [-l line_count] [-a suffix_length] [file [name]]

DESCRIPTION
The split utility reads the given file (or standard input if no file is specified) and breaks it up into files of, by default, 1000 lines each.

The options are as follows:

-b  Create files byte_count bytes in length. If “k” is appended to the number, the file is split into byte_count kilobyte pieces. If “m” is appended to the number, the file is split into byte_count megabyte pieces.

-l  Create output files n lines in length.

-a  Use suffix_length letters to form the suffix portion of the filenames of the split file. If -a is not specified, the default suffix length will be two. If the sum of the name operand and the suffix_length option-argument would create a filename exceeding {NAME_MAX} bytes, an error will occur, and split will exit with no output files having been created.

If additional arguments are specified, the first is used as the name of the input file which is to be split. A “-” character may be used as the first argument, to specify that Standard Input is to be used. If a second additional argument is specified, it is used as a prefix for the names of the files into which the file is split. In this case, each file into which the file is split is named by the prefix followed by a lexically ordered suffix in the range of “aa-zz”. (If suffix_length is provided, the suffix will be created using the specified number of characters, rather than the default of two characters.)

If the name argument is not specified, the file is split into lexically ordered files named in the range of “xaa-xzz”.

HISTORY
A split command appeared in AT&T UNIX.