1split(1) User Commands split(1)
2
3
4
6 split - split a file into pieces
7
9 split [-linecount | -l linecount] [-a suffixlength]
10 [file [name]]
11
12
13 split [-b n | nk | nm] [-a suffixlength] [file [name]]
14
15
17 The split utility reads file and writes it in linecount-line pieces
18 into a set of output-files. The name of the first output-file is name
19 with aa appended, and so on lexicographically, up to zz (a maximum of
20 676 files). The maximum length of name is 2 characters less than the
21 maximum filename length allowed by the filesystem. See statvfs(2). If
22 no output name is given, x is used as the default (output-files will be
23 called xaa, xab, and so forth).
24
26 The following options are supported:
27
28 −linecount | -l linecount
29
30 Number of lines in each piece. Defaults to 1000 lines.
31
32
33 -a suffixlength
34
35 Uses suffixlength letters to form the suffix portion of the file‐
36 names of the split file. If -a is not specified, the default suffix
37 length is 2. If the sum of the name operand and the suffixlength
38 option-argument would create a filename exceeding NAME_MAX bytes,
39 an error will result; split will exit with a diagnostic message and
40 no files will be created.
41
42
43 -b n
44
45 Splits a file into pieces n bytes in size.
46
47
48 -b nk
49
50 Splits a file into pieces n*1024 bytes in size.
51
52
53 -b nm
54
55 Splits a file into pieces n*1048576 bytes in size.
56
57
59 The following operands are supported:
60
61 file The path name of the ordinary file to be split. If no input
62 file is given or file is −, the standard input will be used.
63
64
65 name The prefix to be used for each of the files resulting from the
66 split operation. If no name argument is given, x will be used
67 as the prefix of the output files. The combined length of the
68 basename of prefix and suffixlength cannot exceed NAME_MAX
69 bytes. See OPTIONS.
70
71
73 See largefile(5) for the description of the behavior of split when
74 encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
75
77 See environ(5) for descriptions of the following environment variables
78 that affect the execution of split: LANG, LC_ALL, LC_CTYPE, LC_MES‐
79 SAGES, and NLSPATH.
80
82 The following exit values are returned:
83
84 0 Successful completion.
85
86
87 >0 An error occurred.
88
89
91 See attributes(5) for descriptions of the following attributes:
92
93
94
95
96 ┌─────────────────────────────┬─────────────────────────────┐
97 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
98 ├─────────────────────────────┼─────────────────────────────┤
99 │Availability │SUNWesu │
100 ├─────────────────────────────┼─────────────────────────────┤
101 │CSI │Enabled │
102 ├─────────────────────────────┼─────────────────────────────┤
103 │Interface Stability │Committed │
104 ├─────────────────────────────┼─────────────────────────────┤
105 │Standard │See standards(5). │
106 └─────────────────────────────┴─────────────────────────────┘
107
109 csplit(1), statvfs(2), attributes(5), environ(5), largefile(5), stan‐
110 dards(5)
111
112
113
114SunOS 5.11 16 Apr 1999 split(1)