xref: /minix3/usr.bin/split/split.1 (revision 30eeed2c01ebf515c83ba89332f6b0e64670c011)
1*30eeed2cSThomas Cort.\"	$NetBSD: split.1,v 1.15 2007/05/31 01:35:35 jschauma Exp $
2*30eeed2cSThomas Cort.\"
3*30eeed2cSThomas Cort.\" Copyright (c) 1990, 1991, 1993, 1994
4*30eeed2cSThomas Cort.\"	The Regents of the University of California.  All rights reserved.
5*30eeed2cSThomas Cort.\"
6*30eeed2cSThomas Cort.\" Redistribution and use in source and binary forms, with or without
7*30eeed2cSThomas Cort.\" modification, are permitted provided that the following conditions
8*30eeed2cSThomas Cort.\" are met:
9*30eeed2cSThomas Cort.\" 1. Redistributions of source code must retain the above copyright
10*30eeed2cSThomas Cort.\"    notice, this list of conditions and the following disclaimer.
11*30eeed2cSThomas Cort.\" 2. Redistributions in binary form must reproduce the above copyright
12*30eeed2cSThomas Cort.\"    notice, this list of conditions and the following disclaimer in the
13*30eeed2cSThomas Cort.\"    documentation and/or other materials provided with the distribution.
14*30eeed2cSThomas Cort.\" 3. Neither the name of the University nor the names of its contributors
15*30eeed2cSThomas Cort.\"    may be used to endorse or promote products derived from this software
16*30eeed2cSThomas Cort.\"    without specific prior written permission.
17*30eeed2cSThomas Cort.\"
18*30eeed2cSThomas Cort.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19*30eeed2cSThomas Cort.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20*30eeed2cSThomas Cort.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21*30eeed2cSThomas Cort.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22*30eeed2cSThomas Cort.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23*30eeed2cSThomas Cort.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24*30eeed2cSThomas Cort.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25*30eeed2cSThomas Cort.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26*30eeed2cSThomas Cort.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27*30eeed2cSThomas Cort.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28*30eeed2cSThomas Cort.\" SUCH DAMAGE.
29*30eeed2cSThomas Cort.\"
30*30eeed2cSThomas Cort.\"	@(#)split.1	8.3 (Berkeley) 4/16/94
31*30eeed2cSThomas Cort.\"
32*30eeed2cSThomas Cort.Dd May 28, 2007
33*30eeed2cSThomas Cort.Dt SPLIT 1
34*30eeed2cSThomas Cort.Os
35*30eeed2cSThomas Cort.Sh NAME
36*30eeed2cSThomas Cort.Nm split
37*30eeed2cSThomas Cort.Nd split a file into pieces
38*30eeed2cSThomas Cort.Sh SYNOPSIS
39*30eeed2cSThomas Cort.Nm
40*30eeed2cSThomas Cort.Op Fl a Ar suffix_length
41*30eeed2cSThomas Cort.Oo
42*30eeed2cSThomas Cort.Fl b Ar byte_count Ns Oo Li k|m Oc |
43*30eeed2cSThomas Cort.Fl l Ar line_count
44*30eeed2cSThomas Cort.Fl n Ar chunk_count
45*30eeed2cSThomas Cort.Oc
46*30eeed2cSThomas Cort.Op Ar file Op Ar name
47*30eeed2cSThomas Cort.Sh DESCRIPTION
48*30eeed2cSThomas CortThe
49*30eeed2cSThomas Cort.Nm
50*30eeed2cSThomas Cortutility reads the given
51*30eeed2cSThomas Cort.Ar file
52*30eeed2cSThomas Cortand breaks it up into files of 1000 lines each.
53*30eeed2cSThomas CortIf
54*30eeed2cSThomas Cort.Ar file
55*30eeed2cSThomas Cortis a single dash or absent,
56*30eeed2cSThomas Cort.Nm
57*30eeed2cSThomas Cortreads from the standard input.
58*30eeed2cSThomas Cort.Ar file
59*30eeed2cSThomas Cortitself is not altered.
60*30eeed2cSThomas Cort.Pp
61*30eeed2cSThomas CortThe options are as follows:
62*30eeed2cSThomas Cort.Bl -tag -width Ds
63*30eeed2cSThomas Cort.It Fl a
64*30eeed2cSThomas CortUse
65*30eeed2cSThomas Cort.Ar suffix_length
66*30eeed2cSThomas Cortletters to form the suffix of the file name.
67*30eeed2cSThomas Cort.It Fl b
68*30eeed2cSThomas CortCreate smaller files
69*30eeed2cSThomas Cort.Ar byte_count
70*30eeed2cSThomas Cortbytes in length.
71*30eeed2cSThomas CortIf
72*30eeed2cSThomas Cort.Ql k
73*30eeed2cSThomas Cortis appended to the number, the file is split into
74*30eeed2cSThomas Cort.Ar byte_count
75*30eeed2cSThomas Cortkilobyte pieces.
76*30eeed2cSThomas CortIf
77*30eeed2cSThomas Cort.Ql m
78*30eeed2cSThomas Cortis appended to the number, the file is split into
79*30eeed2cSThomas Cort.Ar byte_count
80*30eeed2cSThomas Cortmegabyte pieces.
81*30eeed2cSThomas Cort.It Fl l
82*30eeed2cSThomas CortCreate smaller files
83*30eeed2cSThomas Cort.Ar line_count
84*30eeed2cSThomas Cortlines in length.
85*30eeed2cSThomas Cort.It Fl n
86*30eeed2cSThomas CortSplit file into
87*30eeed2cSThomas Cort.Ar chunk_count
88*30eeed2cSThomas Cortsmaller files.
89*30eeed2cSThomas Cort.El
90*30eeed2cSThomas Cort.Pp
91*30eeed2cSThomas CortIf additional arguments are specified, the first is used as the name
92*30eeed2cSThomas Cortof the input file which is to be split.
93*30eeed2cSThomas CortIf a second additional argument is specified, it is used as a prefix
94*30eeed2cSThomas Cortfor the names of the files into which the file is split.
95*30eeed2cSThomas CortIn this case, each file into which the file is split is named by the
96*30eeed2cSThomas Cortprefix followed by a lexically ordered suffix using
97*30eeed2cSThomas Cort.Ar suffix_length
98*30eeed2cSThomas Cortcharacters in the range
99*30eeed2cSThomas Cort.Dq Li a-z .
100*30eeed2cSThomas CortIf
101*30eeed2cSThomas Cort.Fl a
102*30eeed2cSThomas Cortis not specified, two letters are used as the suffix.
103*30eeed2cSThomas Cort.Pp
104*30eeed2cSThomas CortIf the
105*30eeed2cSThomas Cort.Ar name
106*30eeed2cSThomas Cortargument is not specified,
107*30eeed2cSThomas Cort.Ql x
108*30eeed2cSThomas Cortis used.
109*30eeed2cSThomas Cort.Sh STANDARDS
110*30eeed2cSThomas CortThe
111*30eeed2cSThomas Cort.Nm
112*30eeed2cSThomas Cortutility conforms to
113*30eeed2cSThomas Cort.St -p1003.1-2001 .
114*30eeed2cSThomas Cort.Sh HISTORY
115*30eeed2cSThomas CortA
116*30eeed2cSThomas Cort.Nm
117*30eeed2cSThomas Cortcommand appeared in
118*30eeed2cSThomas Cort.At v6 .
119*30eeed2cSThomas Cort.Pp
120*30eeed2cSThomas CortThe
121*30eeed2cSThomas Cort.Fl a
122*30eeed2cSThomas Cortoption was introduced in
123*30eeed2cSThomas Cort.Nx 2.0 .
124*30eeed2cSThomas CortBefore that, if
125*30eeed2cSThomas Cort.Ar name
126*30eeed2cSThomas Cortwas not specified,
127*30eeed2cSThomas Cort.Nm
128*30eeed2cSThomas Cortwould vary the first letter of the filename
129*30eeed2cSThomas Cortto increase the number of possible output files.
130*30eeed2cSThomas CortThe
131*30eeed2cSThomas Cort.Fl a
132*30eeed2cSThomas Cortoption makes this unnecessary.
133