dd(1M)                                                                  dd(1M)


NAME
     dd - convert and copy a file

SYNOPSIS
     dd [option=value] ...

DESCRIPTION
     dd copies the specified input file to the specified output with possible
     conversions.  The standard input and output are used by default.  The
     input and output block sizes can be specified to take advantage of raw
     physical I/O.  dd processes supplementary code-set characters according
     to the locale specified in the LC_CTYPE environment variable (see LANG in
     environ(5)), except as noted below.

     Option         Values

     if=file        Input filename; standard input is default.

     of=file        Output filename; standard output is default.

     ibs=n          Input block size is n bytes (default 512).

     obs=n          Output block size is n bytes (default 512).

     bs=n           Set both input and output block size, superseding ibs and
                    obs.  Also, if no conversion is specified, preserve the
                    input block size instead of packing short blocks into the
                    output buffer (this is particularly efficient since no
                    in-core copy need be done).

     cbs=n          Conversion buffer size (logical record length).

     files=n        Copy and concatenate n input files before terminating
                    (makes sense only where input is a magnetic tape or
                    similar device).

     skip=n         Skip n input blocks before starting copy (appropriate for
                    magnetic tape, where iseek is undefined).

     iseek=n        Seek n blocks from beginning of input file before copying
                    (appropriate for disk files, where skip can be slow).

     oseek=n        Seek n blocks from beginning of output file before
                    copying.  Preserves the contents (over the range of the
                    seek) of a previously existing output file.

     seek=n         Identical to oseek, retained for backward compatibility.

     count=n        Copy only n input blocks.


     conv=ascii     Convert EBCDIC to ASCII.  Conversion results cannot be
                    assured when supplementary code-set characters are also
                    subject to conversion.

          ebcdic    Convert ASCII to EBCDIC.  Conversion results cannot be
                    assured when supplementary code-set characters are also
                    subject to conversion.

          ibm       Slightly different map of ASCII to EBCDIC.  Conversion
                    results cannot be assured when supplementary code-set
                    characters are also subject to conversion.

     conv=block     Convert newline-terminated ASCII records to fixed length.

          unblock   Convert fixed-length ASCII records to newline-terminated
                    records.

          lcase     Map alphabetics to lowercase.  Multibyte characters are
                    not converted.

          ucase     Map alphabetics to uppercase.  Multibyte characters are
                    not converted.

          swab      Swap every pair of bytes.

          noerror   Do not stop processing on an error (limit of five
                    consecutive errors).  A message is printed on each input
                    error, giving the statistics up to that point.

          ignerror  Do not stop processing on an error at all.  Unlike
                    noerror, the read errors are skipped over if possible, by
                    using lseek64(2), (if possible) and there is no limit on
                    the number of errors.  It is recommended that either ibs
                    or bs be used, and set to the minimum size for the input
                    device, in order to minimize the skipped data.  This can
                    sometimes allow disk drives to be copied even if they
                    contain unreadable blocks, although the output copy will
                    of course have blocks of missing (zero-filled) data.

          notrunc   Do not truncate a pre-existing output file.

          sync      Pad every input block to ibs.  Pad with spaces if
                    conv=block or conv=unblock is specified, otherwise pad
                    with nulls.

          ..., ...  several comma-separated conversions.

     Where sizes are specified, a number of bytes is expected.  A number can
     end with k, b, or w to specify multiplication by 1024, 512, or 2,
     respectively; a pair of numbers can be separated by x to indicate
     multiplication.


     cbs is used only if ascii, unblock, ebcdic, ibm, or block conversion is
     specified.  In the first two cases, cbs characters are copied into the
     conversion buffer, any specified character mapping is done, trailing
     blanks are trimmed, and a newline is added before sending the line to the
     output.  In the latter three cases, characters are read into the
     conversion buffer and blanks are added to make up an output record of
     size cbs.  If cbs is unspecified or zero, the ascii, ebcdic, and ibm
     options convert the character set without changing the block structure of
     the input file; the unblock and block options become a simple file copy.

     After completion, dd reports the number of whole and partial input and
     output blocks.

EXAMPLE
     This command reads an EBCDIC tape that is blocked ten 80-byte EBCDIC card
     images per tape block into the ASCII file x:

          dd if=/dev/rmt/0h of=x ibs=800 obs=8k 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
     block sizes.

FILES
     /usr/lib/locale/locale/LC_MESSAGES/uxcore.abi
                    language-specific message file (see LANG on environ(5))

SEE ALSO
     cp(1), lseek64(2).

DIAGNOSTICS
     f+p records in(out)
          numbers of full and partial blocks read(written)

NOTES
     Do not use dd to copy files between filesystems having different block
     sizes.

     Using a blocked device to copy a file results in extra nulls being added
     to the file to pad the final block to the block boundary.


                                                                        Page 3