1.\" $OpenBSD: split.1,v 1.22 2015/02/28 21:51:56 bentley Exp $ 2.\" $NetBSD: split.1,v 1.5 1994/12/21 08:20:35 jtc Exp $ 3.\" 4.\" Copyright (c) 1990, 1991, 1993, 1994 5.\" The Regents of the University of California. All rights reserved. 6.\" 7.\" Redistribution and use in source and binary forms, with or without 8.\" modification, are permitted provided that the following conditions 9.\" are met: 10.\" 1. Redistributions of source code must retain the above copyright 11.\" notice, this list of conditions and the following disclaimer. 12.\" 2. Redistributions in binary form must reproduce the above copyright 13.\" notice, this list of conditions and the following disclaimer in the 14.\" documentation and/or other materials provided with the distribution. 15.\" 3. Neither the name of the University nor the names of its contributors 16.\" may be used to endorse or promote products derived from this software 17.\" without specific prior written permission. 18.\" 19.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29.\" SUCH DAMAGE. 30.\" 31.\" @(#)split.1 8.3 (Berkeley) 4/16/94 32.\" 33.Dd $Mdocdate: February 28 2015 $ 34.Dt SPLIT 1 35.Os 36.Sh NAME 37.Nm split 38.Nd split a file into pieces 39.Sh SYNOPSIS 40.Nm split 41.Op Fl a Ar suffix_length 42.br 43.Oo 44.Fl b 45.Sm off 46.Ar byte_count Op Cm k | m 47.Sm on 48.No \&| Fl l Ar line_count 49.No \&| Fl p Ar pattern 50.Oc 51.Op Ar file Op Ar name 52.Sh DESCRIPTION 53The 54.Nm 55utility reads the given 56.Ar file , 57or standard input if no file is specified, 58and breaks it up into files of 1000 lines each. 59.Ar file 60itself is not altered. 61.Pp 62The options are as follows: 63.Bl -tag -width Ds 64.It Fl a Ar suffix_length 65Use 66.Ar suffix_length 67letters to form the suffix of the file name 68(see below). 69The default suffix length is 2. 70.It Xo 71.Fl b 72.Sm off 73.Ar byte_count 74.Op Cm k | m 75.Sm on 76.Xc 77Create files 78.Ar byte_count 79bytes in length. 80If 81.Sq k 82is appended to the number, the file is split into 83.Ar byte_count 84kilobyte pieces. 85If 86.Sq m 87is appended to the number, the file is split into 88.Ar byte_count 89megabyte pieces. 90.It Fl l Ar line_count 91Create files 92.Ar line_count 93lines in length. 94.It Fl p Ar pattern 95The file is split whenever an input line matches 96.Ar pattern , 97which is interpreted as an extended regular expression. 98The matching line will be the first line of the next output file. 99This option is incompatible with the 100.Fl b 101and 102.Fl l 103options. 104.El 105.Pp 106If 107.Ar name 108is specified, 109it is used as a prefix 110for the names of the files into which the file is split. 111In this case, each file into which the file is split is named by the 112prefix followed by a lexically ordered suffix using 113.Ar suffix_length 114characters in the range 115.Dq a-z . 116.Pp 117If the 118.Ar name 119argument is not specified, the file is split into lexically ordered 120files named with the prefixes 121.Sq x , 122.Sq y , 123and 124.Sq z . 125.Sh EXIT STATUS 126.Ex -std split 127.Sh SEE ALSO 128.Xr csplit 1 , 129.Xr re_format 7 130.Sh STANDARDS 131The 132.Nm 133utility is compliant with the 134.St -p1003.1-2008 135specification. 136.Pp 137The flag 138.Op Fl p , 139as well as the 140.Sq y 141and 142.Sq z 143prefixes in the absence of a 144.Ar name 145parameter, 146are an extension to that specification. 147.Sh HISTORY 148A 149.Nm 150command appeared in 151.At v3 . 152.Sh BUGS 153The maximum line length for matching patterns is 65536. 154