| 1 | .TH DD 1 |
| 2 | .SH NAME |
| 3 | dd \- convert and copy a file |
| 4 | .SH SYNOPSIS |
| 5 | .B dd |
| 6 | [option=value] ... |
| 7 | .SH DESCRIPTION |
| 8 | .I Dd |
| 9 | copies the specified input file |
| 10 | to the specified output with |
| 11 | possible conversions. |
| 12 | The standard input and output are used by default. |
| 13 | The input and output block size may be |
| 14 | specified to take advantage of raw physical I/O. |
| 15 | .PP |
| 16 | .br |
| 17 | .ns |
| 18 | .TP 15 |
| 19 | .I option |
| 20 | .I values |
| 21 | .br |
| 22 | .ns |
| 23 | .TP |
| 24 | if= |
| 25 | input file name; standard input is default |
| 26 | .br |
| 27 | .ns |
| 28 | .TP |
| 29 | of= |
| 30 | output file name; standard output is default |
| 31 | .br |
| 32 | .ns |
| 33 | .TP |
| 34 | .RI ibs= n |
| 35 | input block size |
| 36 | .I n |
| 37 | bytes (default 512) |
| 38 | .br |
| 39 | .ns |
| 40 | .TP |
| 41 | .RI obs= n |
| 42 | output block size (default 512) |
| 43 | .br |
| 44 | .ns |
| 45 | .TP |
| 46 | .RI bs= n |
| 47 | set both input and output block size, |
| 48 | superseding |
| 49 | .I ibs |
| 50 | and |
| 51 | .I obs; |
| 52 | also, if no conversion is specified, |
| 53 | it is particularly efficient since no copy need be done |
| 54 | .br |
| 55 | .ns |
| 56 | .TP |
| 57 | .RI cbs= n |
| 58 | conversion buffer size |
| 59 | .br |
| 60 | .ns |
| 61 | .TP |
| 62 | .RI skip= n |
| 63 | skip |
| 64 | .IR n "" |
| 65 | input records before starting copy |
| 66 | .br |
| 67 | .ns |
| 68 | .TP |
| 69 | .RI files= n |
| 70 | skip |
| 71 | .I n |
| 72 | input files before starting copy |
| 73 | .br |
| 74 | .ns |
| 75 | .TP |
| 76 | .RI seek= n |
| 77 | seek |
| 78 | .I n |
| 79 | records from beginning of output file before copying |
| 80 | .br |
| 81 | .ns |
| 82 | .TP |
| 83 | count=\fIn\fR |
| 84 | copy only |
| 85 | .IR n "" |
| 86 | input records |
| 87 | .br |
| 88 | .ns |
| 89 | .TP |
| 90 | conv=ascii |
| 91 | .ds h \h'\w'conv='u' |
| 92 | convert EBCDIC to ASCII |
| 93 | .br |
| 94 | .ns |
| 95 | .IP \*hebcdic |
| 96 | convert ASCII to EBCDIC |
| 97 | .br |
| 98 | .ns |
| 99 | .IP \*hibm |
| 100 | slightly different map of ASCII to EBCDIC |
| 101 | .br |
| 102 | .ns |
| 103 | .IP \*hlcase |
| 104 | map alphabetics to lower case |
| 105 | .br |
| 106 | .ns |
| 107 | .IP \*hucase |
| 108 | map alphabetics to upper case |
| 109 | .br |
| 110 | .ns |
| 111 | .IP \*hswab |
| 112 | swap every pair of bytes |
| 113 | .br |
| 114 | .ns |
| 115 | .IP \*hnoerror |
| 116 | do not stop processing on an error |
| 117 | .br |
| 118 | .ns |
| 119 | .IP \*hsync |
| 120 | pad every input record to |
| 121 | .I ibs |
| 122 | .br |
| 123 | .ns |
| 124 | .IP "\*h... , ..." |
| 125 | several comma-separated conversions |
| 126 | .PP |
| 127 | .fi |
| 128 | Where sizes are specified, |
| 129 | a number of bytes is expected. |
| 130 | A number may end with |
| 131 | .B "k, b" |
| 132 | or |
| 133 | .B w |
| 134 | to specify multiplication by |
| 135 | 1024, 512, or 2 respectively; |
| 136 | a pair of numbers may be separated by |
| 137 | .B x |
| 138 | to indicate a product. |
| 139 | .PP |
| 140 | .I Cbs |
| 141 | is used only if |
| 142 | .I ascii |
| 143 | or |
| 144 | .I ebcdic |
| 145 | conversion is specified. |
| 146 | In the former case |
| 147 | .I cbs |
| 148 | characters are placed into the conversion buffer, converted to |
| 149 | ASCII, and trailing blanks trimmed and new-line added |
| 150 | before sending the line to the output. |
| 151 | In the latter case ASCII characters are read into the |
| 152 | conversion buffer, converted to EBCDIC, and blanks added |
| 153 | to make up an |
| 154 | output record of size |
| 155 | .IR cbs . |
| 156 | .PP |
| 157 | After completion, |
| 158 | .I dd |
| 159 | reports the number of whole and partial input and output |
| 160 | blocks. |
| 161 | .PP |
| 162 | For example, to read an EBCDIC tape blocked ten 80-byte |
| 163 | EBCDIC card images per record into the ASCII file |
| 164 | .I x: |
| 165 | .IP |
| 166 | .nf |
| 167 | dd if=/dev/rmt0 of=x ibs=800 cbs=80 conv=ascii,lcase |
| 168 | .fi |
| 169 | .PP |
| 170 | Note the use of raw magtape. |
| 171 | .I Dd |
| 172 | is especially suited to I/O on the raw |
| 173 | physical devices because it allows reading |
| 174 | and writing in arbitrary record sizes. |
| 175 | .SH "SEE ALSO" |
| 176 | cp(1), tr(1) |
| 177 | .SH DIAGNOSTICS |
| 178 | f+p records in(out): numbers of full and partial records read(written) |
| 179 | .SH BUGS |
| 180 | The ASCII/EBCDIC conversion tables are |
| 181 | taken |
| 182 | from the 256 character standard in |
| 183 | the CACM Nov, 1968. |
| 184 | The `ibm' conversion, while less blessed as a standard, |
| 185 | corresponds better to certain IBM print train conventions. |
| 186 | There is no universal solution. |
| 187 | .PP |
| 188 | Newlines are inserted only on conversion to ASCII; |
| 189 | padding is done only on conversion to EBCDIC. |
| 190 | These should be separate options. |