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