BSD 4_3_Tahoe development
[unix-history] / usr / man / cat1 / dd.0
DD(1) UNIX Programmer's Manual DD(1)
N\bNA\bAM\bME\bE
dd - convert and copy a file
S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
d\bdd\bd [option=value] ...
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
_\bD_\bd 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 size may be
specified to take advantage of raw physical I/O.
_\bo_\bp_\bt_\bi_\bo_\bn _\bv_\ba_\bl_\bu_\be_\bs
if= input file name; standard input is default
of= output file name; standard output is default
ibs=_\bn input block size _\bn bytes (default 512)
obs=_\bn output block size (default 512)
bs=_\bn set both input and output block size,
superseding _\bi_\bb_\bs and _\bo_\bb_\bs; also, if no conver-
sion is specified, it is particularly effi-
cient since no copy need be done
cbs=_\bn conversion buffer size
skip=_\bn skip _\bn input records before starting copy
files=_\bn copy _\bn input files before terminating (makes
sense only where input is a magtape or simi-
lar device).
seek=_\bn seek _\bn records from beginning of output file
before copying
count=_\bn copy only _\bn input records
conv=ascii convert EBCDIC to ASCII
ebcdic convert ASCII to EBCDIC
ibm slightly different map of ASCII to EBCDIC
block convert variable length records to fixed
length
unblock convert fixed length records to variable
length
lcase map alphabetics to lower case
ucase map alphabetics to upper case
swab swap every pair of bytes
noerror do not stop processing on an error
sync pad every input record to _\bi_\bb_\bs
... , ... several comma-separated conversions
Where sizes are specified, a number of bytes is expected. A
number may end with k\bk,\b, b\bb or w\bw to specify multiplication by
1024, 512, or 2 respectively; a pair of numbers may be
separated by x\bx to indicate a product.
_\bC_\bb_\bs is used only if _\ba_\bs_\bc_\bi_\bi, _\bu_\bn_\bb_\bl_\bo_\bc_\bk, _\be_\bb_\bc_\bd_\bi_\bc, _\bi_\bb_\bm, or _\bb_\bl_\bo_\bc_\bk
conversion is specified. In the first two cases, _\bc_\bb_\bs char-
acters are placed into the conversion buffer, any specified
character mapping is done, trailing blanks trimmed and new-
Printed 7/9/88 April 29, 1985 1
DD(1) UNIX Programmer's Manual DD(1)
line added before sending the line to the output. In the
latter three cases, characters are read into the conversion
buffer, and blanks added to make up an output record of size
_\bc_\bb_\bs.
After completion, _\bd_\bd reports the number of whole and partial
input and output blocks.
For example, to read an EBCDIC tape blocked ten 80-byte
EBCDIC card images per record into the ASCII file _\bx:
dd if=/dev/rmt0 of=x ibs=800 cbs=80 conv=ascii,lcase
Note the use of raw magtape. _\bD_\bd is especially suited to I/O
on the raw physical devices because it allows reading and
writing in arbitrary record sizes.
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
cp(1), tr(1)
D\bDI\bIA\bAG\bGN\bNO\bOS\bST\bTI\bIC\bCS\bS
f+p records in(out): numbers of full and partial records
read(written)
B\bBU\bUG\bGS\bS
The ASCII/EBCDIC conversion tables are taken from the 256
character standard in the CACM Nov, 1968. The `ibm' conver-
sion, while less blessed as a standard, corresponds better
to certain IBM print train conventions. There is no univer-
sal solution.
One must specify ``conv=noerror,sync'' when copying raw
disks with bad sectors to insure _\bd_\bd stays synchronized.
Certain combinations of arguments to _\bc_\bo_\bn_\bv= are permitted.
However, the _\bb_\bl_\bo_\bc_\bk or _\bu_\bn_\bb_\bl_\bo_\bc_\bk option cannot be combined with
_\ba_\bs_\bc_\bi_\bi, _\be_\bb_\bc_\bd_\bi_\bc or _\bi_\bb_\bm. Invalid combinations _\bs_\bi_\bl_\be_\bn_\bt_\bl_\by _\bi_\bg_\bn_\bo_\br_\be
all but the last mutually-exclusive keyword.
Printed 7/9/88 April 29, 1985 2