teach manpages about largefile's demise
[unleashed.git] / share / man / man1 / split.1
blobf75e864f2260ec72f1512e2941553a9fd54c01cb
1 .\"
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/.
6 .\"
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
9 .\" documentation.
10 .\"
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
13 .\"
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.
24 .\"
25 .\" This notice shall appear on any product containing this material.
26 .\"
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.
30 .\"
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.
35 .\"
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]
41 .\"
42 .\"
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
46 .\"
47 .TH SPLIT 1 "Apr 16, 1999"
48 .SH NAME
49 split \- split a file into pieces
50 .SH SYNOPSIS
51 .LP
52 .nf
53 \fBsplit\fR [\fB-linecount\fR | \fB-l\fR \fIlinecount\fR] [\fB-a\fR \fIsuffixlength\fR]
54      [\fIfile\fR [\fIname\fR]]
55 .fi
57 .LP
58 .nf
59 \fBsplit\fR [\fB-b\fR \fIn\fR | \fIn\fRk | \fIn\fRm] [\fB-a\fR \fIsuffixlength\fR] [\fIfile\fR [\fIname\fR]]
60 .fi
62 .SH DESCRIPTION
63 .sp
64 .LP
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).
72 .SH OPTIONS
73 .sp
74 .LP
75 The following options are supported:
76 .sp
77 .ne 2
78 .na
79 \fB\fB\(mi\fR\fIlinecount\fR \fB|\fR \fB-l\fR \fIlinecount\fR\fR
80 .ad
81 .sp .6
82 .RS 4n
83 Number of lines in each piece. Defaults to \fB1000\fR lines.
84 .RE
86 .sp
87 .ne 2
88 .na
89 \fB\fB-a\fR \fIsuffixlength\fR\fR
90 .ad
91 .sp .6
92 .RS 4n
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
98 will be created.
99 .RE
102 .ne 2
104 \fB\fB-b\fR \fIn\fR\fR
106 .sp .6
107 .RS 4n
108 Splits a file into pieces \fIn\fR bytes in size.
112 .ne 2
114 \fB\fB-b\fR \fIn\fR\fBk\fR\fR
116 .sp .6
117 .RS 4n
118 Splits a file into pieces \fIn\fR\fB*1024\fR bytes in size.
122 .ne 2
124 \fB\fB-b\fR \fIn\fR\fBm\fR\fR
126 .sp .6
127 .RS 4n
128 Splits a file into pieces \fIn\fR\fB*1\|048\|576\fR bytes in size.
131 .SH OPERANDS
134 The following operands are supported:
136 .ne 2
138 \fB\fIfile\fR\fR
140 .RS 8n
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.
146 .ne 2
148 \fB\fIname\fR\fR
150 .RS 8n
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.
157 .SH ENVIRONMENT VARIABLES
160 See \fBenviron\fR(5) for descriptions of the following environment variables
161 that affect the execution of \fBsplit\fR: \fBLANG\fR, \fBLC_ALL\fR,
162 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
163 .SH EXIT STATUS
166 The following exit values are returned:
168 .ne 2
170 \fB\fB0\fR\fR
172 .RS 6n
173 Successful completion.
177 .ne 2
179 \fB\fB>0\fR\fR
181 .RS 6n
182 An error occurred.
185 .SH ATTRIBUTES
188 See \fBattributes\fR(5) for descriptions of the following attributes:
193 box;
194 c | c
195 l | l .
196 ATTRIBUTE TYPE  ATTRIBUTE VALUE
198 CSI     Enabled
200 Interface Stability     Committed
202 Standard        See  \fBstandards\fR(5).
205 .SH SEE ALSO
208 \fBcsplit\fR(1), \fBstatvfs\fR(2), \fBattributes\fR(5), \fBenviron\fR(5),
209 \fBstandards\fR(5)