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