dd(8) CLIX dd(8)
NAME
dd - Converts and copies a file
SYNOPSIS
dd [option=value ... ]
DESCRIPTION
The dd command copies the specified input file to the specified output
with possible conversions. The stdin and stdout are used by default. The
input and output block size may be specified to take advantage of raw
physical I/O.
The following options are available:
if=file Input filename; stdin is the default.
of=file Output filename; stdout is the default.
ibs=n Input block size, in n bytes; the default value is 512.
obs=n Output block size, in n bytes; the default value is 512
bs=n Sets both input and output block size, superseding ibs and
obs. If no conversion is specified, this is particularly
efficient, since no in-core copy need be done.
cbs=n Conversion buffer size.
skip=n Skip n input blocks before starting copy.
seek=n Seek n blocks from beginning of output file before
copying.
count=n Copy only n input blocks.
conv=string Convert, where string is one of the following:
ebcdic Convert ASCII to EBCDIC.
ibm Slightly different map of ASCII to EBCDIC.
lcase Map alphabetics to lowercase.
ucase Map alphabetics to uppercase.
swab Swap every pair of bytes.
noerror Do not stop processing on an error.
2/94 - Intergraph Corporation 1
dd(8) CLIX dd(8)
sync Pad every input block to ibs.
... , ... Several comma-separated conversions.
Where sizes are specified, a number of bytes is expected. A number may
end with k, b, or w to specify multiplication by 1024, 512, or 2,
respectively; a pair of numbers may be separated by x to indicate
multiplication.
The cbs option is used only if conv=ascii or conv=ebcdic is specified. In
the former case, cbs characters are placed into the conversion buffer
(converted to ASCII). Trailing blanks are trimmed and a newline added
before sending the line to the output. In the latter case, ASCII
characters are read into the conversion buffer (converted to EBCDIC).
Blanks are added to make up an output block of size cbs.
After completion, dd reports the number of whole and partial input and
output blocks.
EXAMPLES
1. The following reads the floppy disk and writes the data to
/tmp/infile:
dd if=/dev/dsk/f1 of=/tmp/infile
2. The following reads /tmp/infile, converts ASCII to EBCDIC, and writes
the data to /tmp/newfile:
dd if=/tmp/infile conv=ebcdic of=/tmp/newfile
DIAGNOSTICS
f+p blocks in
f+p blocks out
Numbers of full and partial blocks read and written.
write error: No such device or address
Could not write to the designated output device. For a quarter-
inch tape device, this error occurs if the output block size
specified is not a multiple of 512.
EXIT VALUES
The dd command exits with a value of 0 if successful, 2 if it fails, or 3
if it tries to skip past the end-of-file.
2 Intergraph Corporation - 2/94