Commit | Line | Data |
---|---|---|
3f162d28 C |
1 | .TH DD 1 "18 January 1983" |
2 | .UC 4 | |
3 | .SH NAME | |
4 | dd \- convert and copy a file | |
5 | .SH SYNOPSIS | |
6 | .B dd | |
7 | [option=value] ... | |
8 | .SH DESCRIPTION | |
9 | .I Dd | |
10 | copies the specified input file | |
11 | to the specified output with | |
12 | possible conversions. | |
13 | The standard input and output are used by default. | |
14 | The input and output block size may be | |
15 | specified to take advantage of raw physical I/O. | |
16 | .PP | |
17 | .br | |
18 | .ns | |
19 | .TP 15 | |
20 | .I option | |
21 | .I values | |
22 | .br | |
23 | .ns | |
24 | .TP | |
25 | if= | |
26 | input file name; standard input is default | |
27 | .br | |
28 | .ns | |
29 | .TP | |
30 | of= | |
31 | output file name; standard output is default | |
32 | .br | |
33 | .ns | |
34 | .TP | |
35 | .RI ibs= n | |
36 | input block size | |
37 | .I n | |
38 | bytes (default 512) | |
39 | .br | |
40 | .ns | |
41 | .TP | |
42 | .RI obs= n | |
43 | output block size (default 512) | |
44 | .br | |
45 | .ns | |
46 | .TP | |
47 | .RI bs= n | |
48 | set both input and output block size, | |
49 | superseding | |
50 | .I ibs | |
51 | and | |
52 | .I obs; | |
53 | also, if no conversion is specified, | |
54 | it is particularly efficient since no copy need be done | |
55 | .br | |
56 | .ns | |
57 | .TP | |
58 | .RI cbs= n | |
59 | conversion buffer size | |
60 | .br | |
61 | .ns | |
62 | .TP | |
63 | .RI skip= n | |
64 | skip | |
65 | .IR n "" | |
66 | input records before starting copy | |
67 | .br | |
68 | .ns | |
69 | .TP | |
70 | .RI files= n | |
71 | copy | |
72 | .I n | |
73 | input files before terminating (makes sense only | |
74 | where input is a magtape or similar device). | |
75 | .br | |
76 | .ns | |
77 | .TP | |
78 | .RI seek= n | |
79 | seek | |
80 | .I n | |
81 | records from beginning of output file before copying | |
82 | .br | |
83 | .ns | |
84 | .TP | |
85 | count=\fIn\fR | |
86 | copy only | |
87 | .IR n "" | |
88 | input records | |
89 | .br | |
90 | .ns | |
91 | .TP | |
92 | conv=ascii | |
93 | .ds h \h'\w'conv='u' | |
94 | convert EBCDIC to ASCII | |
95 | .br | |
96 | .ns | |
97 | .IP \*hebcdic | |
98 | convert ASCII to EBCDIC | |
99 | .br | |
100 | .ns | |
101 | .IP \*hibm | |
102 | slightly different map of ASCII to EBCDIC | |
103 | .br | |
104 | .ns | |
105 | .IP \*hblock | |
106 | convert variable length records to fixed length | |
107 | .br | |
108 | .ns | |
109 | .IP \*hunblock | |
110 | convert fixed length records to variable length | |
111 | .br | |
112 | .ns | |
113 | .IP \*hlcase | |
114 | map alphabetics to lower case | |
115 | .br | |
116 | .ns | |
117 | .IP \*hucase | |
118 | map alphabetics to upper case | |
119 | .br | |
120 | .ns | |
121 | .IP \*hswab | |
122 | swap every pair of bytes | |
123 | .br | |
124 | .ns | |
125 | .IP \*hnoerror | |
126 | do not stop processing on an error | |
127 | .br | |
128 | .ns | |
129 | .IP \*hsync | |
130 | pad every input record to | |
131 | .I ibs | |
132 | .br | |
133 | .ns | |
134 | .IP "\*h... , ..." | |
135 | several comma-separated conversions | |
136 | .PP | |
137 | .fi | |
138 | Where sizes are specified, | |
139 | a number of bytes is expected. | |
140 | A number may end with | |
141 | .B "k, b" | |
142 | or | |
143 | .B w | |
144 | to specify multiplication by | |
145 | 1024, 512, or 2 respectively; | |
146 | a pair of numbers may be separated by | |
147 | .B x | |
148 | to indicate a product. | |
149 | .PP | |
150 | .I Cbs | |
151 | is used only if | |
152 | .I ascii, | |
153 | .I unblock, | |
154 | .I ebcdic, | |
155 | .I ibm, | |
156 | or | |
157 | .I block | |
158 | conversion is specified. | |
159 | In the first two cases, | |
160 | .I cbs | |
161 | characters are placed into the conversion buffer, any specified | |
162 | character mapping is done, | |
163 | trailing blanks trimmed and new-line added | |
164 | before sending the line to the output. | |
165 | In the latter three cases, characters are read into the | |
166 | conversion buffer, and blanks added | |
167 | to make up an | |
168 | output record of size | |
169 | .IR cbs . | |
170 | .PP | |
171 | After completion, | |
172 | .I dd | |
173 | reports the number of whole and partial input and output | |
174 | blocks. | |
175 | .PP | |
176 | For example, to read an EBCDIC tape blocked ten 80-byte | |
177 | EBCDIC card images per record into the ASCII file | |
178 | .I x: | |
179 | .IP | |
180 | .nf | |
181 | dd if=/dev/rmt0 of=x ibs=800 cbs=80 conv=ascii,lcase | |
182 | .fi | |
183 | .PP | |
184 | Note the use of raw magtape. | |
185 | .I Dd | |
186 | is especially suited to I/O on the raw | |
187 | physical devices because it allows reading | |
188 | and writing in arbitrary record sizes. | |
189 | .SH "SEE ALSO" | |
190 | cp(1), tr(1) | |
191 | .SH DIAGNOSTICS | |
192 | f+p records in(out): numbers of full and partial records read(written) | |
193 | .SH BUGS | |
194 | The ASCII/EBCDIC conversion tables are | |
195 | taken | |
196 | from the 256 character standard in | |
197 | the CACM Nov, 1968. | |
198 | The `ibm' conversion, while less blessed as a standard, | |
199 | corresponds better to certain IBM print train conventions. | |
200 | There is no universal solution. |