dd(1) — Commands
OSF
NAME
dd − Converts and copies a file
SYNOPSIS
dd [option=value ...]
DESCRIPTION
The dd command reads the specified input file or standard input, does the specified conversions, and copies it to the specified output file or standard output. The input and output block size may be specified to take advantage of raw physical I/O. The terms block and record refer to the quantity of data read or written by dd in one operation and are not necessarily the same size as a disk block.
Where sizes are specified, a number of bytes is expected. A number may end with w, b, or k to specify multiplication by 2, 512, or 1024, respectively; a pair of numbers can be separated by an x to indicate a product.
The cbs specification is used if one of the following conversions is specified: ascii, unblock, ebcdic, ibm, or block. For the first two conversions, dd places characters in a conversion buffer of size cbs, converts these characters to ASCII, trims trailing spaces, and adds newline characters before sending data to the specified output. For the latter three cases, dd places ASCII characters in the conversion buffer, converts these characters to EBCDIC, and adds trailing spaces to create an output record of size cbs.
After it finishes, dd reports the number of whole and partial input and output blocks.
Options
if=input_file
Specifies the input filename; standard input is the default.
of=output_file
Specifies the output filename; standard output is the default.
ibs=number
Specifies the input block size in bytes; the default is 512.
obs=number
Specifies the output block size in bytes; the default is 512.
bs=number
Specifies both the input and output block size, superseding ibs and obs. If no conversion is specified, it is particularly efficient, since no copy needs to be done.
cbs=number
Specifies the conversion buffer size.
skip=number
Skips number input records before starting copy.
files=number
Copies number input files before terminating (makes sense only where input is a magnetic tape or similar device).
seek=number
Seeks to the numberth record from the beginning of output file before copying.
count=number
Copies only number input records.
conv=specification[,specification ...]
Specifies one or more of the following conversions:
asciiConverts EBCDIC to ASCII.
blockConverts variable-length records to fixed-length.
ebcdicConverts ASCII to EBCDIC.
ibmPerforms a slightly different map of ASCII to EBCDIC.
unblockConverts fixed-length records to variable-length.
lcaseMakes all alphabetic characters lowercase.
ucaseMakes all alphabetic characters uppercase.
swabSwaps every pair of bytes.
noerrorDoes not stop processing on an error.
syncPads every input record to ibs.
... , ...Allows several comma-separated conversions.
EXAMPLES
1.To read an EBCDIC tape blocked ten 80-byte EBCDIC card images per record into the ASCII file x, enter:
dd if=/dev/rmt0 of=x ibs=800 cbs=80 conv=ascii,lcase
Note the use of raw magnetic tape. dd is especially suited to I/O on the raw physical devices because it allows reading and writing in arbitrary record sizes.
2.To convert an ASCII text file to EBCDIC, enter:
dd if=text.ascii of=text.ebcdic conv=ebcdic
This converts text.ascii to EBCDIC representation, storing this in text.ebcdic.
NOTES
1.The ASCII/EBCDIC conversion tables are taken from the 256 character standard in the CACM November, 1968. There is no universal standard for EBCDIC/ASCII translation.
2.One must specify conv=noerror,sync when copying raw disks with bad sectors to ensure dd stays synchronized.
3.Certain combinations of arguments to conv= are permitted. However, the block or unblock option cannot be combined with ascii, ebcdic, or ibm. Invalid combinations silently ignore all but the last mutually exclusive keyword.
4.If you need to use dd to copy to a streaming tape and the data is an odd length (not a multiple of 512 bytes), you must use the conv=sync flag to fill the last record. Streaming tape devices permit only multiples of 512 bytes.
DIAGNOSTICS
This message specifies the number of full and partial records both read and written:
f+p records in
f+p records out
The number of full records read or written (f) refers to the blocks of data of size ibs or obs. The number of partial records read or written (p) refers to the blocks of data smaller than ibs or obs.
RELATED INFORMATION
Commands: cp(1), cpio(1), tar(1), tr(1), trbsd(1).
OSF/1 User’s Guide.