BSD 4_3_Reno development
[unix-history] / usr / share / man / cat1 / dd.0
CommitLineData
0e9d8a17
C
1DD(1) UNIX Reference Manual DD(1)
2
3N\bNA\bAM\bME\bE
4 d\bdd\bd - Convert and copy a file.
5
6S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
7 d\bdd\bd [options ...]
8
9D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
10 The d\bdd\bd utility copies the specified input file to the specified output
11 with possible conversions.
12
13 The following options are available:
14
15 i\bif\bf=\b=_\bf_\bi_\bl_\be Input pathname; standard input is default.
16
17 o\bof\bf=\b=_\bf_\bi_\bl_\be Output pathname; standard output is default.
18
19 i\bib\bbs\bs=\b=_\bn Input block size _\bn bytes (default is 512 bytes).
20
21 o\bob\bbs\bs=\b=_\bn Output block size (default is 512 bytes).
22
23 b\bbs\bs=\b=_\bn Set both input and output block size, superseding i\bib\bbs\bs and o\bob\bbs\bs.
24
25 c\bcb\bbs\bs=\b=_\bn Conversion buffer size
26
27 s\bsk\bki\bip\bp=\b=_\bn Skip _\bn input blocks (each block is the size of i\bib\bbs\bs) before
28 starting copy.
29
30 s\bse\bee\bek\bk=\b=_\bn Seek n blocks (each block is the size of obs) from beginning of
31 output file before copying.
32
33 c\bco\bou\bun\bnt\bt=\b=_\bn Copy only _\bn input blocks.
34
35 c\bco\bon\bnv\bv=\b=_\bv_\ba_\bl_\bu_\be[_\bv_\ba_\bl_\bu_\be ...]
36 Where values are comma-separated symbols from the following
37 list.
38
39 b\bbl\blo\boc\bck\bk Convert variable length records to fixed length.
40 Read characters into the c\bcb\bbs\bs buffer, delete a trail-
41 ing <newline>, and pad to the length of the c\bcb\bbs\bs
42 buffer with <space>s. b\bbl\blo\boc\bck\bk and u\bun\bnb\bbl\blo\boc\bck\bk are mutually
43 exclusive.
44
45 u\bun\bnb\bbl\blo\boc\bck\bk Convert fixed length records to variable length.
46 Read a number of characters equal to the size of the
47 c\bcb\bbs\bs buffer, delete all trailing <blank>s, and append
48 a <newline>.
49
50 l\blc\bca\bas\bse\be Map characters in the alpha character classification
51 from class upper to the corresponding value in class
52 lower. l\blc\bca\bas\bse\be and u\buc\bca\bas\bse\be are mutually exclusive.
53
54 u\buc\bca\bas\bse\be Map characters in the alpha character classification
55 from class lower to the corresponding value in class
56 upper.
57
58 s\bsw\bwa\bab\bb Swap every pair of bytes
59
60 n\bno\boe\ber\brr\bro\bor\br Do not stop processing on an error.
61
62 s\bsy\byn\bnc\bc Pad every input block to the size of i\bib\bbs\bs buffer, ap-
63 pending <space> characters.
64
65 Where sizes are specified, a decimal number of bytes is expected. A size
66 can end with k\bk or b\bb to specify multiplication by 1024 or 512, respective-
67 ly. A pair of sizes can be separated by x\bx to indicate a product.
68 If the option i\bif\bf=\b= is not specified, the standard input is used.
69
70 The input files can be any file type and on completion, d\bdd\bd writes the
71 number of input and output blocks, full and partial counts, to the stan-
72 dard error.
73
74 A partial block may be caused by a read or write operation transferring
75 less than i\bib\bbs\bs bytes. Only bytes read have conversions, as specified by
76 the options, applied to them.
77
78 For SIGINT, the d\bdd\bd utility writes status information to standard error
79 before exiting. It takes the default action for all other signals.
80
81 The d\bdd\bd utility exits 0 on success, and >0 if an error occurs.
82
83 If an error is detected, and the noerror option has not been supplied,
84 the cause is reported and the d\bdd\bd utility aborts the copy of the file.
85
86S\bSE\bEE\bE A\bAL\bLS\bSO\bO
87 tr(1)
88
89S\bST\bTA\bAN\bND\bDA\bAR\bRD\bDS\bS
90 The d\bdd\bd function is expected to be POSIX 1003.2 compatible.