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