<h1 style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; font-size: 22px; clear: both; ">dd</h1><p style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; font-size: 16px; ">Convert and copy a file, write disk headers, boot records, create a boot floppy. dd can make an exact clone of an (unmounted) disk, this will include all blank space so the output destination must be at least as large as the input.</p>
<span class="Apple-style-span" style="font-family: &#39;Times New Roman&#39;; font-size: medium; "><pre style="font-family: &#39;courier new&#39;, &#39;Andale Mono&#39;, courier, monospace; font-size: 16px; ">Syntax
     dd [<em>Options</em>]
         
Key
   if=<i>FILE</i>
      Input file : Read from FILE instead of standard input.

   of=<i>FILE</i>
      Output file : Write to FILE instead of standard output.  Unless `conv=notrunc&#39;
      is given, `dd&#39; truncates FILE to zero bytes (or the size specified
      with `seek=&#39;).

   ibs=<em>BYTES</em>
      Read BYTES bytes at a time.

   obs=<em>BYTES</em>
      Write BYTES bytes at a time.

   bs=<em>BYTES</em>
      Block size, both read and write <i>BYTES</i> bytes at a time.  This overrides `ibs&#39;
      and `obs&#39;.

   cbs=<em>BYTES</em>
      Convert BYTES bytes at a time.

   skip=<em>BLOCKS</em>
      Skip BLOCKS `ibs&#39;-byte blocks in the input file before copying.

   seek=<em>BLOCKS</em>
      Skip BLOCKS `obs&#39;-byte blocks in the output file before copying.

   count=<em>BLOCKS</em>
      Copy BLOCKS `ibs&#39;-byte blocks from the input file, instead of
      everything until the end of the file.

   conv=<em>CONVERSION</em>[,<em>CONVERSION</em>]...
      Convert the file as specified by the CONVERSION argument(s).  
      (No spaces around any comma)

     Conversions:
    `ascii&#39;    Convert EBCDIC to ASCII.
    `ebcdic&#39;   Convert ASCII to EBCDIC.
    `ibm&#39;      Convert ASCII to alternate EBCDIC.
    `block&#39;    For each line in the input, output `cbs&#39; bytes, replacing the
               input newline with a space and padding with spaces as
               necessary.
    `unblock&#39;  Replace trailing spaces in each `cbs&#39;-sized input block with a newline.
    `lcase&#39;    Change uppercase letters to lowercase.
    `ucase&#39;    Change lowercase letters to uppercase.
    `swab&#39;     Swap every pair of input bytes.  GNU `dd&#39;, unlike others,
               works when an odd number of bytes are read--the last byte is
               simply copied (since there is nothing to swap it with).
    `noerror&#39;  Continue after read errors.
    `notrunc&#39;  Do not truncate the output file.
    `sync&#39;     Pad every input block to size of `ibs&#39; with trailing zero bytes.
          </pre></span><p style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; font-size: 16px; ">The numeric-valued options (BYTES and BLOCKS) can be followed by a multiplier: `b&#39;=512, `c&#39;=1, `w&#39;=2, `xM&#39;=M, or any of the standard block size suffixes like `k&#39;=1024.</p>
<p style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; font-size: 16px; "><strong>Examples:</strong></p><p style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; font-size: 16px; ">Clone one hard drive onto another<span class="code" style="font-family: &#39;courier new&#39;, courier, &#39;Andale Mono&#39;, monospace; font-size: 16px; "> <br>
$ dd if=/dev/sda of=/dev/sdb</span></p><p style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; font-size: 16px; ">Clone a hard drive<span class="code" style="font-family: &#39;courier new&#39;, courier, &#39;Andale Mono&#39;, monospace; font-size: 16px; "> </span>to an image file <br>
<span class="code" style="font-family: &#39;courier new&#39;, courier, &#39;Andale Mono&#39;, monospace; font-size: 16px; ">$ dd if=/dev/hda of=/image.img</span></p><p style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; font-size: 16px; ">
Clone a hard drive to a zipped image file in 100Mb blocks <span class="code" style="font-family: &#39;courier new&#39;, courier, &#39;Andale Mono&#39;, monospace; font-size: 16px; "><br>$ dd if=/dev/hda bs=100M | gzip -c &gt; /image.img</span></p>
<p style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; font-size: 16px; ">Create a boot floppy:<br><span class="code" style="font-family: &#39;courier new&#39;, courier, &#39;Andale Mono&#39;, monospace; font-size: 16px; ">$ dd if=boot.img of=/dev/fd0 bs=1440</span></p>
<p style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; font-size: 16px; "><i>&quot;Success isn&#39;t something you chase. It&#39;s something you have to put forth the effort for constantly. Then maybe it&#39;ll come when you least expect it. Most people don&#39;t understand that&quot; - Michael Jordan </i><br>
<br><b>Related</b>:<br><a href="http://www.codecoffee.com/tipsforlinux/articles/036.html" style="color: rgb(0, 0, 255); text-decoration: none; ">CodeCoffee.com</a> - dd examples<br><a href="http://ss64.com/bash/cp.html" style="color: rgb(0, 0, 255); text-decoration: none; ">cp</a> - Copy one or more files to another location<br>
<a href="http://ss64.com/bash/ddrescue.html" style="color: rgb(0, 0, 255); text-decoration: none; ">ddrescue</a> - Data recovery tool <br><a href="http://ss64.com/bash/install.html" style="color: rgb(0, 0, 255); text-decoration: none; ">install</a> - Copy files and set attributes<br>
<a href="http://ss64.com/bash/mtools.html" style="color: rgb(0, 0, 255); text-decoration: none; ">mtools</a> - Manipulate MS-DOS files<br><a href="http://ss64.com/bash/sum.html" style="color: rgb(0, 0, 255); text-decoration: none; ">sum</a> - Print a checksum for a file<br>
Equivalent Windows command: <a href="http://ss64.com/nt/fsutil.html" style="color: rgb(0, 0, 255); text-decoration: none; ">FSUTIL</a> file setzerodata</p>