dd
[option
=
value
]
Make a copy of an input file ( if= ) using the specified conditions, and send the results to the output file (or standard output if of is not specified). Any number of options can be supplied, although if and of are the most common and are usually specified first. Because dd can handle arbitrary block sizes, it is useful when converting between raw physical devices.
n
Set input and output block size to
n
bytes; this option supersedes
ibs
and
obs
.
n
Set the size of the conversion buffer (logical record length) to
n
bytes. Use only if the conversion
flag
is
ascii
,
ebcdic
,
ibm
,
block
, or
unblock
.
flags
Convert the input according to one or more (comma-separated)
flags
listed below. The first five
flags
are mutually exclusive.
EBCDIC to ASCII.
ASCII to EBCDIC.
ASCII to EBCDIC with IBM conventions.
Variable-length records (i.e., those terminated by a newline) to fixed-length records.
Fixed-length records to variable-length.
Uppercase to lowercase.
Lowercase to uppercase.
Continue processing when errors occur (up to 5 in a row).
Swap all pairs of bytes.
Pad input blocks to ibs .
n
Copy only
n
input blocks.
n
Copy
n
input files (e.g., from magnetic tape), then quit.
n
Set input block size to
n
bytes (default is 512).
file
Read input from
file
(default is standard input).
n
Set output block size to
n
bytes (default is 512).
file
Write output to
file
(default is standard output).
n
Seek
n
blocks from start of input file (like
skip
but more efficient for disk file input).
n
Seek
n
blocks from start of output file.
n
Same as oseek (retained for compatibility).
n
Skip
n
input blocks; useful with magnetic tape.
You can multiply size values (
n
) by a factor of 1024, 512, or 2 by appending the letter
k
,
b
, or
w
, respectively. You can use the letter
x
as a multiplication operator between two numbers.
Convert an input file to all lowercase:
dd if=caps_file of=small_file conv=lcase
Retrieve variable-length data; write it as fixed-length to out :
data_retrieval_cmd| dd of=out conv=sync,block