<s>
dd	B-Application
is	O
a	O
command-line	B-Application
utility	O
for	O
Unix	B-Application
,	O
Plan	B-Operating_System
9	I-Operating_System
,	O
Inferno	B-Operating_System
,	O
and	O
Unix-like	B-Operating_System
operating	I-Operating_System
systems	I-Operating_System
and	O
beyond	O
,	O
the	O
primary	O
purpose	O
of	O
which	O
is	O
to	O
convert	O
and	O
copy	O
files	O
.	O
</s>
<s>
On	O
Unix	B-Application
,	O
device	O
drivers	O
for	O
hardware	O
(	O
such	O
as	O
hard	B-Device
disk	I-Device
drives	I-Device
)	O
and	O
special	O
device	B-Application
files	I-Application
(	O
such	O
as	O
/dev/zero	B-Application
and	O
/dev/random	B-Application
)	O
appear	O
in	O
the	O
file	O
system	O
just	O
like	O
normal	O
files	O
;	O
can	O
also	O
read	O
and/or	O
write	O
from/to	O
these	O
files	O
,	O
provided	O
that	O
function	O
is	O
implemented	O
in	O
their	O
respective	O
driver	O
.	O
</s>
<s>
As	O
a	O
result	O
,	O
can	O
be	O
used	O
for	O
tasks	O
such	O
as	O
backing	O
up	O
the	O
boot	B-Device
sector	I-Device
of	O
a	O
hard	B-Device
drive	I-Device
,	O
and	O
obtaining	O
a	O
fixed	O
amount	O
of	O
random	O
data	O
.	O
</s>
<s>
The	O
program	O
can	O
also	O
perform	O
conversions	O
on	O
the	O
data	O
as	O
it	O
is	O
copied	O
,	O
including	O
byte	B-Application
order	O
swapping	O
and	O
conversion	O
to	O
and	O
from	O
the	O
ASCII	B-Protocol
and	O
EBCDIC	B-Language
text	O
encodings	O
.	O
</s>
<s>
The	O
name	O
is	O
an	O
allusion	O
to	O
the	O
DD	B-Application
statement	O
found	O
in	O
IBM	O
's	O
Job	B-Application
Control	I-Application
Language	I-Application
(	O
JCL	O
)	O
,	O
in	O
which	O
it	O
is	O
an	O
abbreviation	O
for	O
"	O
Data	O
Definition	O
"	O
.	O
</s>
<s>
The	O
command	B-Application
's	O
syntax	O
resembles	O
a	O
JCL	O
statement	O
more	O
than	O
other	O
Unix	B-Application
commands	I-Application
do	O
,	O
so	O
much	O
that	O
Eric	O
S	O
.	O
Raymond	O
says	O
"	O
the	O
interface	O
design	O
was	O
clearly	O
a	O
prank	O
"	O
.	O
</s>
<s>
The	O
interface	O
is	O
redesigned	O
in	O
Plan	B-Operating_System
9	I-Operating_System
's	O
dd	B-Application
command	B-Application
to	O
use	O
a	O
command-line	B-Application
option	O
style	O
.	O
</s>
<s>
dd	B-Application
is	O
sometimes	O
humorously	O
called	O
"	O
Disk	O
Destroyer	O
"	O
,	O
due	O
to	O
its	O
drive-erasing	O
capabilities	O
.	O
</s>
<s>
Originally	O
intended	O
to	O
convert	O
between	O
ASCII	B-Protocol
and	O
EBCDIC	B-Language
,	O
first	O
appeared	O
in	O
Version	B-Operating_System
5	I-Operating_System
Unix	I-Operating_System
.	O
</s>
<s>
The	O
command	B-Application
is	O
specified	O
since	O
the	O
X/Open	O
Portability	O
Guide	O
issue	O
2	O
of	O
1987	O
.	O
</s>
<s>
This	O
is	O
inherited	O
by	O
IEEE	O
Std	O
1003.1-2008	O
(	O
POSIX	O
)	O
,	O
which	O
is	O
part	O
of	O
the	O
Single	O
UNIX	B-Application
Specification	O
.	O
</s>
<s>
The	O
version	O
of	O
dd	B-Application
bundled	O
in	O
GNU	B-Application
coreutils	I-Application
was	O
written	O
by	O
Paul	O
Rubin	O
,	O
David	O
MacKenzie	O
,	O
and	O
Stuart	O
Kemp	O
.	O
</s>
<s>
The	O
command	B-Application
is	O
available	O
as	O
a	O
separate	O
package	O
for	O
Microsoft	B-Application
Windows	I-Application
as	O
part	O
of	O
the	O
UnxUtils	B-Application
collection	O
of	O
native	B-Language
Win32	B-Library
ports	O
of	O
common	O
GNU	B-Operating_System
Unix-like	B-Operating_System
utilities	O
.	O
</s>
<s>
The	O
command	B-Application
line	I-Application
syntax	O
of	O
differs	O
from	O
many	O
other	O
Unix	B-Application
programs	O
.	O
</s>
<s>
It	O
uses	O
the	O
syntax	O
for	O
its	O
command-line	B-Application
options	O
rather	O
than	O
the	O
more	O
standard	O
or	O
formats	O
.	O
</s>
<s>
Sending	O
a	O
SIGINFO	B-General_Concept
signal	O
(	O
or	O
a	O
USR1	O
signal	O
on	O
Linux	B-Application
)	O
to	O
a	O
running	O
process	O
makes	O
it	O
print	O
I/O	O
statistics	O
to	O
standard	O
error	O
once	O
and	O
then	O
continue	O
copying	O
.	O
</s>
<s>
When	O
end-of-file	B-Language
(	O
EOF	O
)	O
is	O
reached	O
,	O
will	O
exit	O
.	O
</s>
<s>
For	O
example	O
,	O
Unix	B-Application
tools	I-Application
ported	O
to	O
Windows	B-Application
vary	O
as	O
to	O
the	O
EOF	O
:	O
Cygwin	B-Language
uses	O
(	O
the	O
usual	O
Unix	B-Application
EOF	O
)	O
and	O
MKS	B-Application
Toolkit	I-Application
uses	O
(	O
the	O
usual	O
Windows	B-Application
EOF	O
)	O
.	O
</s>
<s>
The	O
non-standardized	O
parts	O
of	O
dd	B-Application
invocation	O
vary	O
among	O
implementations	O
.	O
</s>
<s>
The	O
manual	O
page	O
for	O
GNU	B-Operating_System
dd	B-Application
does	O
not	O
describe	O
this	O
format	O
,	O
but	O
the	O
BSD	O
manuals	O
do	O
.	O
</s>
<s>
because	O
the	O
physical	O
medium	O
ended	O
before	O
a	O
complete	O
block	B-General_Concept
was	O
read	O
,	O
or	O
a	O
physical	O
error	O
prevented	O
reading	O
the	O
complete	O
block	B-General_Concept
.	O
</s>
<s>
A	O
block	B-General_Concept
is	O
a	O
unit	O
measuring	O
the	O
number	O
of	O
bytes	B-Application
that	O
are	O
read	O
,	O
written	O
,	O
or	O
converted	O
at	O
one	O
time	O
.	O
</s>
<s>
Command-line	B-Application
options	O
can	O
specify	O
a	O
different	O
block	B-General_Concept
size	I-General_Concept
for	O
input/reading	O
(	O
)	O
compared	O
to	O
output/writing	O
(	O
)	O
,	O
though	O
the	O
block	B-General_Concept
size	I-General_Concept
(	O
)	O
option	O
will	O
override	O
both	O
and	O
.	O
</s>
<s>
The	O
default	O
value	O
for	O
both	O
input	O
and	O
output	O
block	B-General_Concept
sizes	I-General_Concept
is	O
512	O
bytes	B-Application
(	O
the	O
traditional	O
block	B-General_Concept
size	I-General_Concept
of	O
disks	O
,	O
and	O
POSIX-mandated	O
size	O
of	O
"	O
a	O
block	B-General_Concept
"	O
)	O
.	O
</s>
<s>
Conversion	O
operations	O
are	O
also	O
affected	O
by	O
the	O
"	O
conversion	O
block	B-General_Concept
size	I-General_Concept
"	O
(	O
)	O
.	O
</s>
<s>
The	O
value	O
provided	O
for	O
block	B-General_Concept
size	I-General_Concept
options	O
is	O
interpreted	O
as	O
a	O
decimal	O
(	O
base	O
10	O
)	O
integer	O
number	O
of	O
bytes	B-Application
.	O
</s>
<s>
It	O
can	O
also	O
contain	O
suffixes	O
to	O
indicate	O
that	O
the	O
block	B-General_Concept
size	I-General_Concept
is	O
an	O
integer	O
number	O
of	O
larger	O
units	O
than	O
bytes	B-Application
.	O
</s>
<s>
Implementation	O
differ	O
on	O
the	O
additional	O
suffixes	O
they	O
support	O
:	O
(	O
Free	O
)	O
BSD	O
uses	O
lowercase	O
(	O
mebibytes	O
)	O
,	O
(	O
gibibytes	O
)	O
,	O
and	O
so	O
on	O
for	O
tebibytes	O
,	O
exbibytes	O
,	O
pebibytes	O
,	O
zebibytes	O
,	O
and	O
yobibytes	O
,	O
while	O
GNU	B-Operating_System
uses	O
and	O
for	O
the	O
same	O
units	O
,	O
with	O
,	O
,	O
and	O
used	O
for	O
their	O
SI	O
unit	O
counterparts	O
(	O
kilobytes	O
)	O
.	O
</s>
<s>
For	O
example	O
,	O
for	O
GNU	B-Operating_System
,	O
indicates	O
a	O
blocksize	O
of	O
16	O
mebibytes	O
(	O
16777216	O
bytes	B-Application
)	O
and	O
specifies	O
3000	O
bytes	B-Application
.	O
</s>
<s>
Additionally	O
,	O
some	O
implementations	O
understand	O
the	O
character	O
as	O
a	O
multiplication	O
operator	O
for	O
both	O
block	B-General_Concept
size	I-General_Concept
and	O
count	O
parameters	O
.	O
</s>
<s>
For	O
example	O
,	O
is	O
interpreted	O
as	O
2	O
×	O
80	O
×	O
18	O
×	O
512	O
=	O
,	O
the	O
exact	O
size	O
of	O
a	O
1440KiB	O
floppy	B-Device
disk	I-Device
.	O
</s>
<s>
This	O
is	O
required	O
in	O
POSIX	O
,	O
but	O
GNU	B-Operating_System
does	O
not	O
seem	O
to	O
support	O
it	O
.	O
</s>
<s>
Block	B-General_Concept
size	I-General_Concept
has	O
an	O
effect	O
on	O
the	O
performance	O
of	O
copying	O
commands	O
.	O
</s>
<s>
When	O
is	O
used	O
with	O
variable-block-size	O
devices	O
such	O
as	O
tape	O
drives	O
or	O
networks	O
,	O
the	O
block	B-General_Concept
size	I-General_Concept
may	O
determine	O
the	O
tape	O
record	O
size	O
or	O
packet	B-Protocol
size	O
,	O
depending	O
on	O
the	O
network	O
protocol	O
used	O
.	O
</s>
<s>
The	O
command	B-Application
can	O
be	O
used	O
for	O
a	O
variety	O
of	O
purposes	O
.	O
</s>
<s>
For	O
plain-copying	O
commands	O
it	O
tends	O
to	O
be	O
slower	O
than	O
the	O
domain-specific	O
alternatives	O
,	O
but	O
it	O
excels	O
at	O
its	O
unique	O
ability	O
to	O
"	O
overwrite	O
or	O
truncate	O
a	O
file	O
at	O
any	O
point	O
or	O
seek	O
in	O
a	O
file	O
"	O
,	O
a	O
fairly	O
low-level	O
interface	O
to	O
the	O
Unix	B-Application
file	O
API	O
.	O
</s>
<s>
The	O
examples	O
below	O
assume	O
the	O
use	O
of	O
GNU	B-Operating_System
dd	B-Application
,	O
mainly	O
in	O
the	O
block	B-General_Concept
size	I-General_Concept
argument	O
.	O
</s>
<s>
can	O
duplicate	O
data	O
across	O
files	O
,	O
devices	O
,	O
partitions	B-Application
and	O
volumes	O
.	O
</s>
<s>
The	O
data	O
may	O
be	O
input	O
or	O
output	O
to	O
and	O
from	O
any	O
of	O
these	O
;	O
but	O
there	O
are	O
important	O
differences	O
concerning	O
the	O
output	O
when	O
going	O
to	O
a	O
partition	B-Application
.	O
</s>
<s>
+Data	O
transfer	O
forms	O
of	O
Creates	O
an	O
ISO	B-General_Concept
disk	I-General_Concept
image	I-General_Concept
from	O
a	O
CD-ROM	O
,	O
DVD	O
or	O
Blu-ray	O
disc	O
.	O
</s>
<s>
Restores	O
a	O
hard	B-Device
disk	I-Device
drive	I-Device
(	O
or	O
an	O
SD	B-Device
card	I-Device
,	O
for	O
example	O
)	O
from	O
a	O
previously	O
created	O
image	O
.	O
</s>
<s>
Create	O
an	O
image	O
of	O
the	O
partition	B-Application
sdb2	O
,	O
using	O
a	O
64	O
MiB	O
block	B-General_Concept
size	I-General_Concept
.	O
</s>
<s>
Clones	B-Application
one	O
partition	B-Application
to	O
another	O
.	O
</s>
<s>
Clones	B-Application
a	O
hard	B-Device
disk	I-Device
drive	I-Device
"	O
ad0	O
"	O
to	O
"	O
ad1	O
"	O
.	O
</s>
<s>
For	O
example	O
,	O
this	O
overwrites	O
the	O
first	O
512	O
bytes	B-Application
of	O
a	O
file	O
with	O
null	O
bytes	B-Application
:	O
</s>
<s>
The	O
conversion	O
option	O
means	O
do	O
not	O
truncate	O
the	O
output	O
file	O
—	O
that	O
is	O
,	O
if	O
the	O
output	O
file	O
already	O
exists	O
,	O
just	O
replace	O
the	O
specified	O
bytes	B-Application
and	O
leave	O
the	O
rest	O
of	O
the	O
output	O
file	O
alone	O
.	O
</s>
<s>
Without	O
this	O
option	O
,	O
would	O
create	O
an	O
output	O
file	O
512	O
bytes	B-Application
long	O
.	O
</s>
<s>
The	O
example	O
above	O
can	O
also	O
be	O
used	O
to	O
back	B-Protocol
up	I-Protocol
and	O
restore	O
any	O
region	O
of	O
a	O
device	O
to	O
a	O
file	O
,	O
such	O
as	O
a	O
master	B-Device
boot	I-Device
record	I-Device
.	O
</s>
<s>
To	O
duplicate	O
the	O
first	O
two	O
sectors	O
of	O
a	O
floppy	B-Device
disk	I-Device
:	O
</s>
<s>
This	O
can	O
be	O
achieved	O
by	O
a	O
"	O
data	O
transfer	O
"	O
from	O
the	O
Unix	B-Application
special	B-Application
files	I-Application
.	O
</s>
<s>
To	O
write	O
zeros	O
to	O
a	O
disk	O
,	O
use	O
dd	B-Application
if	O
=	O
/dev/zero	B-Application
of	O
=	O
/dev/sda	O
bs	O
=	O
16M	O
.	O
</s>
<s>
To	O
write	O
random	O
data	O
to	O
a	O
disk	O
,	O
use	O
dd	B-Application
if	O
=	O
/dev/urandom	B-Application
of	O
=	O
/dev/sda	O
bs	O
=	O
16M	O
.	O
</s>
<s>
When	O
compared	O
to	O
the	O
data	O
modification	O
example	O
above	O
,	O
conversion	O
option	O
is	O
not	O
required	O
as	O
it	O
has	O
no	O
effect	O
when	O
the	O
'	O
s	O
output	O
file	O
is	O
a	O
block	B-General_Concept
device	O
.	O
</s>
<s>
The	O
option	O
makes	O
dd	B-Application
read	O
and	O
write	O
16mebibytes	O
at	O
a	O
time	O
.	O
</s>
<s>
For	O
modern	O
systems	O
,	O
an	O
even	O
greater	O
block	B-General_Concept
size	I-General_Concept
may	O
be	O
faster	O
.	O
</s>
<s>
On	O
modern	O
hard-disk	B-Device
drives	I-Device
,	O
zeroing	O
the	O
drive	O
will	O
render	O
most	O
data	O
it	O
contains	O
permanently	O
irrecoverable	O
.	O
</s>
<s>
Modern	O
hard	B-Device
disk	I-Device
drives	I-Device
contain	O
a	O
Secure	O
Erase	O
command	B-Application
designed	O
to	O
permanently	O
and	O
securely	O
erase	O
every	O
accessible	O
and	O
inaccessible	O
portion	O
of	O
a	O
drive	O
.	O
</s>
<s>
It	O
may	O
also	O
work	O
for	O
some	O
solid-state	B-Device
drives	I-Device
(	O
flash	O
drives	O
)	O
.	O
</s>
<s>
As	O
of	O
2017	O
,	O
it	O
does	O
not	O
work	O
on	O
USB	O
flash	O
drives	O
nor	O
on	O
Secure	B-Device
Digital	I-Device
flash	O
memories	O
.	O
</s>
<s>
When	O
available	O
,	O
this	O
is	O
both	O
faster	O
than	O
using	O
dd	B-Application
,	O
and	O
more	O
secure	O
.	O
</s>
<s>
On	O
Linux	B-Application
machines	O
it	O
is	O
accessible	O
via	O
the	O
hdparm	B-Application
command	B-Application
's	O
option	O
.	O
</s>
<s>
The	O
shred	B-Application
program	O
offers	O
multiple	O
overwrites	O
,	O
as	O
well	O
as	O
more	O
secure	O
deletion	O
of	O
individual	O
files	O
.	O
</s>
<s>
Data	B-Application
recovery	I-Application
involves	O
reading	O
from	O
a	O
drive	O
with	O
some	O
parts	O
potentially	O
inaccessible	O
.	O
</s>
<s>
The	O
single	O
block	B-General_Concept
size	I-General_Concept
also	O
limits	O
the	O
granuarity	O
of	O
the	O
recovery	O
,	O
as	O
a	O
trade-off	O
has	O
to	O
be	O
made	O
:	O
either	O
use	O
a	O
small	O
one	O
for	O
more	O
data	O
recovered	O
or	O
use	O
a	O
large	O
one	O
for	O
speed	O
.	O
</s>
<s>
A	O
C	B-Language
program	I-Language
called	O
was	O
written	O
in	O
October	O
1999	O
.	O
</s>
<s>
It	O
did	O
away	O
with	O
the	O
conversion	O
functionality	O
of	O
,	O
and	O
supports	O
two	O
block	B-General_Concept
sizes	I-General_Concept
to	O
deal	O
with	O
the	O
dilemma	O
.	O
</s>
<s>
In	O
2004	O
,	O
GNU	B-Operating_System
wrote	O
a	O
separate	O
utility	O
,	O
unrelated	O
to	O
,	O
called	O
.	O
</s>
<s>
It	O
has	O
a	O
more	O
sophisticated	O
dynamic	O
block-size	O
algorithm	O
and	O
keeps	O
track	O
of	O
what	O
has	O
been	O
read	O
internally	O
.	O
</s>
<s>
To	O
help	O
distinguish	O
the	O
newer	O
GNU	B-Operating_System
program	O
from	O
the	O
older	O
script	O
,	O
alternate	O
names	O
are	O
sometimes	O
used	O
for	O
GNU	B-Operating_System
's	O
,	O
including	O
(	O
the	O
name	O
on	O
freecode.com	O
and	O
freshmeat.net	O
)	O
,	O
(	O
Debian	O
package	O
name	O
)	O
,	O
and	O
(	O
openSUSE	B-Operating_System
package	O
name	O
)	O
.	O
</s>
<s>
Another	O
open-source	B-Application
program	I-Application
called	O
uses	O
a	O
sophisticated	O
algorithm	O
,	O
but	O
it	O
also	O
requires	O
the	O
installation	O
of	O
its	B-Language
own	I-Language
programming-language	I-Language
interpreter	I-Language
.	O
</s>
<s>
To	O
make	O
drive	O
benchmark	O
test	O
and	O
analyze	O
the	O
sequential	O
(	O
and	O
usually	O
single-threaded	O
)	O
system	O
read	O
and	O
write	O
performance	O
for	O
1024-byte	O
blocks	O
:	O
</s>
<s>
To	O
make	O
a	O
file	O
of	O
100	O
random	O
bytes	B-Application
using	O
the	O
kernel	O
random	O
driver	O
:	O
</s>
<s>
This	O
can	O
be	O
overcome	O
by	O
sending	O
an	O
signal	O
to	O
the	O
running	O
GNU	B-Operating_System
process	O
(	O
on	O
BSD	O
systems	O
)	O
,	O
resulting	O
in	O
printing	O
the	O
current	O
number	O
of	O
transferred	O
blocks	O
.	O
</s>
<s>
The	O
following	O
one-liner	O
results	O
in	O
continuous	O
output	O
of	O
progress	O
every	O
10seconds	O
until	O
the	O
transfer	O
is	O
finished	O
,	O
when	O
is	O
replaced	O
by	O
the	O
process-id	O
of	O
:	O
</s>
<s>
Newer	O
versions	O
of	O
GNU	B-Operating_System
support	O
the	O
option	O
,	O
which	O
enables	O
periodic	O
printing	O
of	O
transfer	O
statistics	O
to	O
stderr	O
.	O
</s>
<s>
is	O
a	O
fork	B-Application
of	O
GNU	B-Operating_System
that	O
is	O
an	O
enhanced	O
version	O
developed	O
by	O
Nick	O
Harbour	O
,	O
who	O
at	O
the	O
time	O
was	O
working	O
for	O
the	O
United	O
States	O
 '	O
Department	O
of	O
Defense	O
Computer	O
Forensics	O
Lab	O
.	O
</s>
<s>
is	O
another	O
enhanced	O
GNU	B-Operating_System
from	O
the	O
United	O
States	O
Department	O
of	O
Defense	O
Cyber	O
Crime	O
Center	O
(	O
DC3	O
)	O
.	O
</s>
<s>
It	O
can	O
be	O
seen	O
as	O
a	O
continuation	O
of	O
the	O
dcfldd	O
,	O
with	O
a	O
stated	O
aim	O
of	O
updating	O
whenever	O
the	O
GNU	B-Operating_System
upstream	O
is	O
updated	O
.	O
</s>
