DD(1) BSD DD(1)
NAME
dd - convert and copy a file
SYNOPSIS
dd [ option=value ] ...
DESCRIPTION
The dd command copies the specified input file to the specified output
with possible conversions. It uses the standard input and output by
default. You can specify the input and output block size to take
advantage of raw physical I/O. After completion, dd reports the number
of whole and partial input and output blocks.
OPTIONS
if=file Input filename; standard input is the default.
of=file Output filename; standard output is the default.
ibs=n Input block size n bytes; 512 is the default.
obs=n Output block size; 512 is the default.
bs=n Set both input and output block size, superseding ibs and
obs. If you do not specify conversion, this is
particularly efficient since no copy is required.
cbs=n Conversion buffer size; used only if ascii, unblock,
ebcdic, ibm, or block conversion is specified. In the
first two cases, cbs characters are placed in the
conversion buffer, any specified character mapping is
done, trailing blanks are trimmed, and a newline is added
before sending the line to the output. In the latter
three cases, characters are read into the conversion
buffer, and blanks are added to make up an output record
of size cbs.
skip=n Skip n input records before starting copy.
files=n Copy n input files before terminating This option makes
sense only where input is a magtape or similar device.
seek=n Seek n records from the beginning of the output file
before copying.
count=n Copy only n input records.
conv=ascii Convert EBCDIC to ASCII.
ebcdic Convert ASCII to EBCDIC.
ibm A slightly different map of ASCII to EBCDIC.
block Convert variable-length records to fixed-length records.
unblock Convert fixed-length records to variable-length records.
lcase Map alphabetics to lowercase.
ucase Map alphabetics to uppercase.
swab Swap every pair of bytes.
noerror Do not stop processing on an error.
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 can be separated by x to indicate a
product.
NOTES
Certain combinations of arguments to conv= are permitted. However, you
cannot combine the block or unblock options with ascii, ebcdic or ibm.
Invalid combinations silently ignore all but the last mutually-exclusive
keyword.
The ASCII/EBCDIC conversion tables are taken from the 256-character
standard in the CACM (Nov., 1968). The ibm conversion, while less
blessed as a standard, corresponds better to certain IBM print-train
conventions. There is no universal solution.
EXAMPLE
To read an EBCDIC tape, blocked ten 80-byte EBCDIC card images per
record, into the ASCII file x, type the following:
dd if=/dev/rmt0 of=x ibs=800 cbs=80 conv=ascii,lcase
Note the use of raw magtape. dd is especially suited to I/O on the raw
physical devices because it allows reading and writing in arbitrary
record sizes.
DIAGNOSTICS
"f+p records in(out):" numbers of full and partial records read(written)
BUGS
You must specify conv=noerror,sync when copying raw disks with bad
sectors to ensure that dd stays synchronized.
Domain/OS BSD does not support some raw I/O devices typically used with
dd.
SEE ALSO
cp(1), tr(1)