.TH split "" "" Command
.PC "Split a text file into smaller files"
\fBsplit [\-\fIlines\^\fB][\-c\fIcount\fB][\fIinfile \fB[\fIoutfile\^\fB] ]\fR
.PP
.HS
If \fIinfile\fI is `-' or no \fIinfile\fR, stdin is read.
\fIoutfile\fR defaults to \fBx\fR.
\fIlines\fR is number of lines for text files,
\fIcount\fR is the character count for binary files.
.HE
.B split
divides a file into a number of smaller files.
This is especially useful for dividing text files into chunks that can be
managed by \*(ME or similar editors, or for dividing binary files
into chunks that can be easily transmitted via \*(UU.
.PP
.B split
uses
.I infile
as its input file if given;
otherwise,
it uses the standard input.
If
.I infile
is `\-',
.B split
uses the standard input.
.PP
.B split
puts its output into files with names prefixed by
.I outfile
and suffixed consecutively with
.BR aa ,
.BR ab ,
.BR ac ,
and so on.
If no
.I outfile
is specified, file names are prefixed with
.BR x .
.PP
Normally,
.B split
puts 1,000 lines in each output file.
This default may be changed for text files by the option
.BI \- lines,
where
.I lines
gives the desired number of lines per file.
When using
.B split
on binary files, the argument
.I count
to the
.B -c
option lets you specify the number of characters to place into each output file.
.SH "See Also"
.Xr "commands" commands
