Manual Page Result
0
Command: dd | Section: 1 | Source: Digital UNIX | File: dd.1.gz
dd(1) General Commands Manual dd(1)
NAME
dd - Converts and copies a file
SYNOPSIS
dd [option=value...]
STANDARDS
Interfaces documented on this reference page conform to industry stan-
dards as follows:
dd: XPG4, XPG4-UNIX
Refer to the standards(5) reference page for more information about in-
dustry standards and associated tags.
OPTIONS
None
OPERANDS
The option=value operand set may take any of the following forms: Spec-
ifies the input file name; standard input is the default. Specifies
the output file name; standard output is the default. Specifies the
input block size in bytes; the default is 512. Specifies the output
block size in bytes; the default is 512. Specifies both the input and
output block size, superseding ibs and obs. Specifies the conversion
buffer size. Skips number input records before starting copy. [DIGI-
TAL] Copies number input files before terminating (makes sense only
where input is a magnetic tape or similar device). [DIGITAL] Seeks to
the numberth record from the beginning of input file before copying.
[DIGITAL] Seeks to the numberth record from the beginning of output
file before copying. Same as seek=number. Seeks to the numberth
record from the beginning of output file before copying. Same as os-
eek=number. Copies only number input records. Specifies one or more
of the following conversions: Converts EBCDIC to ASCII. Converts vari-
able-length records to fixed-length. Converts ASCII to EBCDIC. Con-
verts IBM-EBCDIC to ASCII. Performs a slightly different map of ASCII
to EBCDIC. Converts fixed-length records to variable-length. Makes
all alphabetic characters lower case. Makes all alphabetic characters
upper case. Swaps every pair of bytes. Does not stop processing on an
error. Pads every input record to ibs. [DIGITAL] Creates a sparse
output file as described in AdvFS Administration. Do not truncate the
output file. Preserve blocks in the output file not explicitly written
by this invocation of the dd utility. (See the of=output_file operand.)
Allows several comma-separated conversions.
DESCRIPTION
The dd command reads the specified input file or standard input, does
the specified conversions, and copies it to the specified output file
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 re-
fer to the quantity of data read or written by dd in one operation 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 multiplication by 2, 512, or 1024, re-
spectively; a pair of numbers can be separated by an x to indicate a
product.
The cbs specification is used if one of the following conversions is
specified: ascii, unblock, ebcdic, ibm, or block. For the first two
conversions, dd places characters in a conversion buffer of size cbs,
converts these characters to ASCII, trims trailing spaces, and adds
newline characters before sending data to the specified output. For
the latter three cases, dd places ASCII characters in the conversion
buffer, converts these characters to EBCDIC, and adds trailing spaces
to create an output record of size cbs.
After it finishes, dd reports the number of whole and partial input and
output blocks.
NOTES
[DIGITAL] To copy to a raw disk, the disk label must first be zeroed
using the disklabel -z command. For example: disklabel -z rz17
[DIGITAL] If you do not zero out the disk label, dd fails with
the following error message: dd write error: Read-only file sys-
tem The ASCII/EBCDIC conversion tables are taken from the 256
character standard in the CACM November, 1968. There is no uni-
versal standard for EBCDIC/ASCII translation. [DIGITAL] One
must specify conv=noerror,sync when copying raw disks with bad
sectors to ensure dd stays synchronized. [DIGITAL] Certain
combinations of arguments to conv= are permitted. However, the
block or unblock option cannot be combined with ascii, ebcdic,
or ibm. Invalid combinations silently ignore all but the last
mutually exclusive keyword. [DIGITAL] 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 flag to fill
the last record. Streaming tape devices permit only multiples
of 512 bytes. [DIGITAL] If option bs is used (or bs is equal
to obs) and no conversion is specified, then dd is particularly
efficient since less memory copies are done. [DIGITAL] The dd
command does not support floppy disk multivolumes, but it does
support tape multivolumes. This means that when ENOSPC is re-
turned while reading or writing a tape, dd will prompt the user
for a new tape.
[DIGITAL] In order to make use of tape multivolumes, the files
option must be used.
Security Note
[DIGITAL] Any file system archive that contains ACLs (access control
lists) that was created using dd is not exportable unless the target
system has the exact same password and group files. If there is a mis-
match, incorrect access may be granted to a file or directory.
EXIT STATUS
The following exit values are returned: The input file was successfully
copied. An error occurred
DIAGNOSTICS
This message specifies the number of full and partial records both read
and written:
f+p records in f+p records out
The number of full records read or written (f) refers to the blocks of
data of size ibs or obs. The number of partial records read or written
(p) refers to the blocks of data smaller than ibs or obs.
EXAMPLES
To read an EBCDIC tape blocked ten 80-byte EBCDIC card images per
record into the ASCII file x, enter: dd if=/dev/rmt0 of=x ibs=800
cbs=80 conv=ascii,lcase
Note the use of raw magnetic tape. The dd command is especially
suited to I/O on the raw physical devices because it allows
reading and writing in arbitrary record sizes. To convert an
ASCII text file to EBCDIC, enter: dd if=text.ascii
of=text.ebcdic conv=ebcdic
This converts text.ascii to EBCDIC representation, storing this
in text.ebcdic.
ENVIRONMENT VARIABLES
The following environment variables affect the execution of dd: Pro-
vides a default value for the internationalization variables that are
unset or null. If LANG is unset or null, the corresponding value from
the default locale is used. If any of the internationalization vari-
ables contain an invalid setting, the utility behaves as if none of the
variables had been defined. If set to a non-empty string value, over-
rides the values of all the other internationalization variables. De-
termines the locale for the interpretation of sequences of bytes of
text data as characters (for example, single-byte as opposed to multi-
byte characters in arguments). Determines the locale for the format
and contents of diagnostic messages written to standard error. Deter-
mines the location of message catalogues for the processing of LC_MES-
SAGES.
SEE ALSO
Commands: cp(1), cpio(1), sed(1), tar(1), tr(1), trbsd(1)
Functions: lseek(2)
Routines: fseek(3)
Files: ascii(5)
Standards: standards(5)
Command and Shell User's Guide
AdvFS Administration
dd(1)