Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ dd(1) — DG/UX R4.11MU05

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cp(1)

deblock(1)



dd(1)                          DG/UX R4.11MU05                         dd(1)


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 may be specified to take
       advantage of raw physical I/O.

       Option          Values
       if=file         Input file name; standard input is default
       of=file         Output file name; standard output is default
       ibs=n           Input block size n bytes (default 512)
       obs=n           Output block size 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
       count=n         Copy only n input blocks
       conv=ascii      Convert EBCDIC to ASCII
            ebcdic     Convert ASCII to EBCDIC
            ibm        Slightly different map of ASCII to EBCDIC
            block      Convert new-line terminated ASCII records to fixed
                       length
            unblock    Convert fixed length ASCII records to new-line
                       terminated records
            lcase      Map alphabetics to lowercase
            ucase      Map alphabetics to uppercase
            swab       Swap every pair of bytes
            noerror    Do not stop processing on an error (limit of 5
                       consecutive errors)
            notrunc    Do not truncate the output file
            sync       Pad every input block to ibs
            multi-volume-input
                       dd will ask whether there is another input volume
                       each time one is exhausted
            multi-volume-output
                       dd will ask for another output volume each time one
                       is filled
            ... , ...  Several comma-separated conversions

       Where sizes are specified, a number of bytes is expected.  A number
       may end with k, b, or w to specify multiplication by 1024, 512, or 2,
       respectively; a pair of numbers may 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 new-line 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.

EXAMPLES
       To convert a file from lowercase to uppercase:

       $ cat file1
       this file contains only lower case letters.
       $ dd if=file1 of=file2 conv=ucase
       $ cat file2
       THIS FILE CONTAINS ONLY LOWER CASE LETTERS.
       $

       To write file0, file1, and file2 to magnetic tape:

       $ dd if=file0 of=/dev/rmt/0n conv=sync
       $ dd if=file1 of=/dev/rmt/0n conv=sync
       $ dd if=file2 of=/dev/rmt/0 conv=sync

DIAGNOSTICS
       f+p records in(out)      Numbers of full and partial blocks
                                read(written)
       n truncated record(s)    Written only if n is larger than 0

SEE ALSO
       cp(1), deblock(1).

NOTES
       The medium size should be an exact multiple of the block size when
       performing operations that will reach the end of a virtual disk or
       diskette.  The safest block size to use with QIC-150 cartridges is
       512, particularly when writing with conv=multi-volume-output.
       Multiples of 512 up to 8192 or 16384 may work; larger multiples often
       will not.

       You can use conv=multi-volume-output to copy a large virtual disk to
       a set of tapes, and conv=multi-volume-input to restore, but you must
       be careful to insert the tapes in the correct order.  dd simply
       copies data; it does not write any sort of identification to each
       volume, and cannot detect attempts to restore volumes in the wrong
       order.

       You can use conv=multi-volume-input,multi-volume-output to copy a set
       of tapes, but whether the output will be equivalent to the input
       depends on the format of the data.  This will work for tapes
       containing a single archive produced by the -H bin, odc, asc, or crc
       options of cpio(1), since cpio(1) is unaffected by the location or
       existence of volume crossings and the archive has no special markings
       at the beginnings or ends of volumes.  This will not work for tar(1)
       or dump2(1M) archives (you would have to make identical copies of
       each individual volume).

       conv=multi-volume-input expects a simple data stream where tapes
       contain end-of-file markers only at the ends of volumes and at the
       end of the data.  Say you have a tape that contains one cpio(1)
       archive and part of a second, and another tape that contains the rest
       of the second cpio(1) archive.  To make a copy, perform a dd command
       from the no-rewind device without conv=multi-volume-input, followed
       by another dd command from the rewind device with conv=multi-volume-
       input.

       The ASCII/EBCDIC conversion tables are taken from the 256-character
       standard in the CACM Nov, 1968.  These do not always correspond to
       certain IBM® print train conventions.  There is no universal
       solution.


Licensed material--property of copyright holder(s)

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