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