SPLIT ( 1 ) USER COMMANDSSPLIT ( 1 )


NAME

split - split files into pieces

SYNOPSIS

split [ options ] [ file [ name ] ]

DESCRIPTION

split reads an input file and writes one or more output files so that cat(1) on these files will produce the input file. The default size for each piece is 1000 lines. The suffix consists of suffix_len lower case characters from the POSIX locale.

If prefix is specified it will be used as a prefix for each of the resulting files from the split operation. If prefix is specified, the prefix x will be used.

If no file is given, or if the file is -, split copies from standard input starting at the current location.

The option arguments for -b and -C can optionally be followed by one of the following characters to specify a different unit other than a single byte:

b
512 bytes.
k
1-killobytes.
m
1-megabyte.
g
1-gigabyte.
t
1-terabyte.

For backwards compatibility, -line_count is equivalent to -l line_count.

OPTIONS

-l, --lines=line_count

line_count specified the number of lines for each piece except the last. If the input does not end in a newline, the partial line is included in the last piece. The default value is 1000.
-a|n, --suffix-length=suffix_len

suffix_len defines the number of letters that form the suffix portion of the file names for each of the pieces that the file is split into. The default value is 2.
-b, --bytes=n

Splits the file into byte size pieces defined by n rather than lines.
-C, --line-bytes=n

Splits the file into lines totaling a most n bytes.

EXIT STATUS

0
Successful completion.
>0

An error occurred.

SEE ALSO

csplit(1), cat(1)

IMPLEMENTATION

version

split (AT&T Research) 2006-09-19
author

David Korn <dgkorn@gmail.com>
author

Glenn Fowler <glenn.s.fowler@gmail.com>
copyright

Copyright © 1995-2012 AT&T Intellectual Property
license

http://www.eclipse.org/org/documents/epl-v10.html