.TH dd "" "" Command
.PC "Convert the contents of a file"
\fBdd [\fIoption=value\^\fB] ... \fR
.PP
.HS
.SH Options:
.IC \fBbs=\fIn\fR
Set I/O buffer size to \fIn\fR
.IC \fBcbs=\fIn\fR
Set conversion buffer size to \fIn\fR
.IC \fBconv=\fIlist\fR
Comma-separated list of conversions:
.IC "   \fBascii\fR"
Convert EBCDIC to ASCII
.IC "   \fBebcdic\fR"
Convert ASCII to standard EBCDIC
.IC "   \fBibm\fR"
Convert ASCII to IBM print codes
.IC "   \fBlcase\fR"
Map all letters to lower case
.IC "   \fBnoerror\fR"
Continue if error occurs
.IC "   \fBswab\fR"
Swap byte pairs
.IC "   \fBsync\fR"
Pad input to \fIibs\fR
.IC "   \fBucase\fR"
Map all letters to upper case
.IC \fBcount=\fIn\fR
Number of buffers to copy from input
.IC \fBfiles=\fIn\fR
Number of files to copy (useful with tape)
.IC \fBibs=\fIn\fR
Input buffer size
.IC \fBif=\fIfile\fR
Set input file to \fIfile\fR
.IC \fBobs=\fIn\fR
Set output block size to \fIn\fR
.IC \fBof=\fIfile\fR
Set output file to \fIfile\fR
.IC \fBseek=\fIn\fR
Set seek position of output to \fIn\fR
.IC \fBskip=\fIn\fR
Skip \fIn\fR input blocks
.HE
.B dd
copies an input file to an output file, while performing
requested conversions.
Options include case and character set conversions,
byte swapping conversion for other machines,
and different input and output buffer sizes.
.B dd
can be used with raw disk files or raw tape files
to do efficient copies with large block (record) sizes.
Read and write requests can be changed with the
.B bs
option described below.
.PP
The following list gives each available
.IR option .
Any numbers which specify
block sizes or seek positions may be written in several
ways.
A number followed by
.BR w ,
.BR b ,
or
.B k
is multiplied by two (for words),
512 (for blocks), or
1,024 (for kilobytes), respectively,
to obtain the size in bytes.
A pair of such numbers separated by
.B x
is multiplied together to produce the size.
All buffer sizes default to 512 bytes if not specified.
.RS
.IP \fBbs=\fIn\fR 0.75i
Set the size of the buffer for both input and output
to
.I n
bytes.
.IP \fBcbs=\fIn\fR
Set the conversion buffer size to
.I n
bytes
(used only with character set conversions
between ASCII and EBCDIC).
.IP \fBconv=\fIlist\fR
Perform conversions specified by the comma-separated
.IR list ,
which may include the following:
.ID
.ta 1.0i
\fBascii\fR	Convert EBCDIC to ASCII
\fBebcdic\fR	Convert ASCII to EBCDIC
\fBibm\fR	Convert ASCII to EBCDIC, IBM flavor
\fBlcase\fR	Convert upper case to lower
\fBnoerror\fR	Continue processing on I/O errors
\fBswab\fR	Swap every pair of bytes before output
\fBsync\fR	Pad input buffers with 0 bytes to size of \fBibs\fR
\fBucase\fR	Convert lower case to upper
.IE
.IP \fBcount=\fIn\fR
Copy a maximum of
.I n
input records.
.IP \fBfiles=\fIn\fR
Copy a maximum of
.I n
input files (useful for multifile tapes).
.IP \fBibs=\fIn\fR
Set the input buffer size to
.I n
(normally used if input and output blocking sizes are to be different).
.IP \fBif=\fIfile\fR
Open
.I file
for input;
the standard input is used when no
.B if=
option is given.
.IP \fBobs=\fIn\fR
Set the output buffer size to
.I n.
.IP \fBof=\fIfile\fR
Open
.I file
for output;
the standard output is used when no
.B of=
option is given.
.IP \fBseek=\fIn\fR
Seek to position
.I n
bytes into the output before copying
(does not work on stream data such as
tapes, communications devices, and pipes).
.IP \fBskip=\fIn\fR
Read and discard the first
.I n
input records.
.RE
.SH Examples
The first example
copies the entire contents of a 1.44-megabyte, 3.5-inch diskette from drive 0
to file
.BR disk.dd :
.DM
	dd if=/dev/fva0 of=disk.dd bs=36b count=80
.DE
.PP
The second example
writes the contents of the previously stored 5.25-inch file
.B backup.dd
to a 1.2-megabyte, 5.25-inch floppy disk in drive 1:
.DM
	dd if=backup.dd of=/dev/fha1 bs=30b count=80
.DE
.SH "See Also"
.Xr "ASCII," ascii
.Xr "commands," commands
.Xr "conv," conv
.Xr "cp," cp
.Xr "tape," tape
.Xr "tr" tr
.SH Diagnostics
The command reports the number of full and partial buffers
read and written upon completion.
.SH Notes
Because of differing interpretations of EBCDIC,
especially for certain more exotic graphic characters such
as braces and backslash,
no one conversion table will be adequate for all applications.
The
.B ebcdic
table is the American Standard of the
Business Equipment Manufacturers Association.
The
.B ibm
table seems to be more practical for
line printer codes at many IBM installations.
