Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ dd(1) — AIX/RT 2.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cp

ebcdic

tape

dd

PURPOSE

     Converts and copies a file.

SYNOPSIS
     dd [ option=value ] ...


DESCRIPTION

     The  dd command  reads the  specified infile  or standard
     input, does  the specified conversions, and  copies it to
     the specified outfile 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 opera-
     tion  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 multipli-
     cation by 2, 512, or 1024 respectively; a pair of numbers
     can be separated by an x to indicate a product.

     The  conversion requested  by conv=tonls  translates each
     extended character  in a text  file to a  printable ASCII
     escape  sequence that  uniquely  identifies the  extended
     character.   The  complementary conversion,  provided  by
     conv=fromnls,  translates ASCII  escape sequences  to the
     corresponding   extended   character.    The   conversion
     requested  by conv=flatten  translates an  extended char-
     acter to the single ASCII character most resembling it in

     appearance or to a "?"  (question mark) if no ASCII char-
     acters resemble that extended character.

     The character set mappings associated with conv=ascii and
     conv=ebcdic  are complementary  operations, described  in
     the ebcdic file in  AIX Operating System Technical Refer-
     ence.  These attempt to map  between ASCII and the subset
     of EBCDIC that is found on most terminals and keypunches.

     The cbs specification is used only if the ascii or ebcdic
     conversion  is  specified.   For  ASCII  conversions,  dd
     places  characters in  a conversion  buffer of  size cbs,
     converts these characters to ASCII, trims trailing blanks
     and adds  new-line characters before sending  data speci-
     fied  output.  For  EBCDIC conversions,  it places  ASCII
     characters in the conversion buffer, converts these char-
     acters to EBCDIC, adds  trailing blanks to create records
     of size cbs.

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

     Notes:

     1.  Normally, you  need only  write access to  the output
         file.   However, when  the output  file is  not on  a
         direct access device and  you use the seek parameter,
         you also need read access to the file.

     2.  The dd command inserts  new-line characters only when
         converting to ASCII; it  pads only when converting to
         EBCDIC.

     3.  Use the backup, tar, or  cpio commands instead of the
         dd command  whenever possible to copy  files to tape.
         These  commands  are  designed   for  use  with  tape
         devices.

     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 option to fill the
         last record.  Streaming tape devices permit only mul-
         tiples of 512 bytes.

PARAMETERS

     if=infile                Specifies  the input  file name;
                              standard input is the default.
     of=outfile               Specifies the  output file name;
                              standard output is the default.
     ibs=num                  Specifies  the input  block size
                              in bytes; the default is 512.
     obs=num                  Specifies the  output block size
                              in bytes; the default is 512.
     bs=num                   Specifies  both  the  input  and
                              output  block size,  superseding
                              ibs and obs.
     cbs=num                  Specifies the  conversion buffer
                              size.

     skip=num                 Skip  num  input records  before
                              starting copy.
     seek=num                 Seek  to the  numth record  from
                              the  beginning  of  output  file
                              before copying.
     fskip=num                Skip past  num end-of-file char-
                              acters  before   starting  copy;
                              this  parameter  is  useful  for
                              positioning  on multi-file  mag-
                              netic tapes.
     count=num                Copies  only  num input  blocks.
                              The  default block  size is  512
                              bytes (see the ibs parameter).
     conv=spec[,spec . . . ]  Specifies  one  or more  of  the
                              following conversions:
                              ascii    Converts    EBCDIC   to
                                       ASCII.
                              ebcdic   Converts    ASCII    to
                                       EBCDIC.
                              tonls    Converts  ASCII  escape
                                       sequences  to  extended
                                       characters.
                              fromnls  Converts extended char-
                                       acters to  ASCII escape
                                       sequences.
                              flatten  Converts extended char-
                                       acters  to   the  ASCII
                                       character  most  resem-
                                       bling  it or  to a  "?"
                                       (question mark).
                              iblock
                              oblock
                              block    Minimizes   data   loss
                                       resulting  from a  read
                                       or   write   error   on
                                       direct  access devices.
                                       If  you specify  iblock
                                       and  an   error  occurs
                                       during  a   block  read
                                       (where  the block  size
                                       is  512   or  the  size
                                       specified  by ibs=num),
                                       dd  attempts to  reread
                                       the   data   block   in
                                       smaller size units.  If
                                       dd  can  determine  the
                                       sector   size  of   the
                                       input device,  it reads
                                       the   bad  record   one
                                       sector at a time.  Oth-
                                       erwise, it reads it 512
                                       bytes  at a  time.  The
                                       input block  size (ibs)
                                       must  be a  multiple of
                                       this    "retry   size."
                                       This allows you to max-
                                       imize disk  input effi-
                                       ciency  while  ensuring
                                       that data  loss associ-
                                       ated with  a read error

                                       is confined to a single
                                       sector.    The   oblock
                                       conversion  works simi-
                                       larly on output.  Spec-
                                       ifying block is same as
                                       specifying
                                       iblock,oblock.
                              lcase    Makes   all  alphabetic
                                       characters lowercase.
                              ucase    Makes   all  alphabetic
                                       characters uppercase.
                              swab     Swaps  every   pair  of
                                       bytes.
                              noerror  Does  not   stop  proc-
                                       essing on an error.
                              sync     Pads every input record
                                       to ibs.

EXAMPLE

     1.  To convert an ASCII text file to EBCDIC:

           dd if=text.ascii of=text.ebcdic conv=ebcdic

         This converts "text.ascii"  to EBCDIC representation,
         storing the EBCDIC version in "text.ebcdic".

         Note:   When you  specify "conv=ebcdic",  dd converts
         the  ASCII  ^  (circumflex) character  to  an  unused
         EBCDIC  character  (9A   hexadecimal),  and  ASCII  ~
         (tilde) to EBCDIC ^ (NOT symbol).
     2.  To use dd as a filter:

           li -l | dd conv=ucase

         This displays a long listing of the current directory
         ("li -l") in uppercase.

RELATED INFORMATION

     The following command:  "cp."

     The ebcdic and  tape files in AIX  Operating System Tech-
     nical Reference.

     The "Overview of International Character Support" in Man-
     aging the AIX Operating System.

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026