DD(1)
NAME
dd − convert and copy a file
USAGE
dd [ option=value ] ...
DESCRIPTION
Dd copies the specified input file to the specified output with possible conversions. By default, it uses the standard input and output. You may specify the input and output block size. After completion, dd reports the number of whole and partial input and output blocks.
OPTIONS
option values
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 no conversion is specified, this is particularly efficient since no in-core copy is required.
cbs=n Conversion buffer size; used only if ascii, ebcdic, ibm, block, or unblock conversion is specified. In the former case, cbs characters are placed into the conversion buffer, converted to ASCII, trailing blanks 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, and blanks added to make up an output block of size cbs.
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=ascii Convert EBCDIC to ASCII.
ebcdic Convert ASCII to EBCDIC.
block Convert variable-length records to fixed-length records.
unblock Convert fixed-length records to variable-length records.
ibm A 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.
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 a product.
Certain combinations of arguments to conv= are permitted. However, the block or unblock options cannot be combined 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 accepted as a standard, corresponds better to certain IBM print train conventions.
EXAMPLE
To read an EBCDIC tape, blocked ten 80-byte EBCDIC card images per block, 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.
CAUTIONS
DOMAIN/IX does not support some raw I/O devices typically used with dd. You must specify conv=noerror,sync when copying raw disks with bad sectors to ensure that dd remains synchronized.
DIAGNOSTICS
f+p blocks in(out)numbers of full and partial blocks read(written)