2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group. In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document. The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
25 .\" This notice shall appear on any product containing this material.
27 .\" The contents of this file are subject to the terms of the
28 .\" Common Development and Distribution License (the "License").
29 .\" You may not use this file except in compliance with the License.
31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 .\" or http://www.opensolaris.org/os/licensing.
33 .\" See the License for the specific language governing permissions
34 .\" and limitations under the License.
36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 .\" If applicable, add the following below this CDDL HEADER, with the
39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
43 .\" Copyright 1989 AT&T
44 .\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
45 .\" Copyright (c) 1999, Sun Microsystems, Inc. All Rights Reserved
47 .TH SPLIT 1 "Apr 16, 1999"
49 split \- split a file into pieces
53 \fBsplit\fR [\fB-linecount\fR | \fB-l\fR \fIlinecount\fR] [\fB-a\fR \fIsuffixlength\fR]
54 [\fIfile\fR [\fIname\fR]]
59 \fBsplit\fR [\fB-b\fR \fIn\fR | \fIn\fRk | \fIn\fRm] [\fB-a\fR \fIsuffixlength\fR] [\fIfile\fR [\fIname\fR]]
65 The \fBsplit\fR utility reads \fIfile\fR and writes it in \fIlinecount\fR-line
66 pieces into a set of output-files. The name of the first output-file is
67 \fIname\fR with \fBaa\fR appended, and so on lexicographically, up to \fBzz\fR
68 (a maximum of 676 files). The maximum length of \fIname\fR is 2 characters less
69 than the maximum filename length allowed by the filesystem. See
70 \fBstatvfs\fR(2). If no output name is given, \fBx\fR is used as the default
71 (output-files will be called \fBxaa\fR, \fBxab\fR, and so forth).
75 The following options are supported:
79 \fB\fB\(mi\fR\fIlinecount\fR \fB|\fR \fB-l\fR \fIlinecount\fR\fR
83 Number of lines in each piece. Defaults to \fB1000\fR lines.
89 \fB\fB-a\fR \fIsuffixlength\fR\fR
93 Uses \fIsuffixlength\fR letters to form the suffix portion of the filenames of
94 the split file. If \fB-a\fR is not specified, the default suffix length is
95 \fB2\fR. If the sum of the \fIname\fR operand and the \fIsuffixlength\fR
96 option-argument would create a filename exceeding \fINAME_MAX\fR bytes, an
97 error will result; \fBsplit\fR will exit with a diagnostic message and no files
104 \fB\fB-b\fR \fIn\fR\fR
108 Splits a file into pieces \fIn\fR bytes in size.
114 \fB\fB-b\fR \fIn\fR\fBk\fR\fR
118 Splits a file into pieces \fIn\fR\fB*1024\fR bytes in size.
124 \fB\fB-b\fR \fIn\fR\fBm\fR\fR
128 Splits a file into pieces \fIn\fR\fB*1\|048\|576\fR bytes in size.
134 The following operands are supported:
141 The path name of the ordinary file to be split. If no input file is given or
142 \fIfile\fR is \fB\(mi\fR, the standard input will be used.
151 The prefix to be used for each of the files resulting from the \fBsplit\fR
152 operation. If no \fIname\fR argument is given, \fBx\fR will be used as the
153 prefix of the output files. The combined length of the basename of \fIprefix\fR
154 and \fIsuffixlength\fR cannot exceed \fINAME_MAX\fR bytes. See OPTIONS.
160 See \fBlargefile\fR(5) for the description of the behavior of \fBsplit\fR when
161 encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
162 .SH ENVIRONMENT VARIABLES
165 See \fBenviron\fR(5) for descriptions of the following environment variables
166 that affect the execution of \fBsplit\fR: \fBLANG\fR, \fBLC_ALL\fR,
167 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
171 The following exit values are returned:
178 Successful completion.
193 See \fBattributes\fR(5) for descriptions of the following attributes:
201 ATTRIBUTE TYPE ATTRIBUTE VALUE
205 Interface Stability Committed
207 Standard See \fBstandards\fR(5).
213 \fBcsplit\fR(1), \fBstatvfs\fR(2), \fBattributes\fR(5), \fBenviron\fR(5),
214 \fBlargefile\fR(5), \fBstandards\fR(5)