.\" .\" Sccsid @(#)dd.1 1.7 (gritter) 1/14/05 .\" .\" Parts taken from dd(1), Unix 7th edition: .\" Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" Redistributions of source code and documentation must retain the .\" above copyright notice, this list of conditions and the following .\" disclaimer. .\" Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed or owned by Caldera .\" International, Inc. .\" Neither the name of Caldera International, Inc. nor the names of .\" other contributors may be used to endorse or promote products .\" derived from this software without specific prior written permission. .\" .\" USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA .\" INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE .\" LIABLE FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR .\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, .\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE .\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .TH DD 1 "1/14/05" "Heirloom Toolchest" "User Commands" .SH NAME dd \- convert and copy a file .SH SYNOPSIS .B dd [option=value] ... .SH DESCRIPTION .I 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 size may be specified to take advantage of raw physical I/O. .PP .br .ns .TP 15 .I option .I values .br .ns .TP if= input file name; standard input is default .br .ns .TP of= output file name; standard output is default .br .ns .TP .RI ibs= n input block size .I n bytes (default 512) .br .ns .TP .RI obs= n output block size (default 512) .br .ns .TP .RI bs= n set both input and output block size, superseding .I ibs and .I obs; also, if no conversion is specified, it is particularly efficient since no copy need be done .br .ns .TP .RI cbs= n conversion buffer size .br .ns .TP .RI skip= n skip .IR n "" input records before starting copy .br .ns .TP .RI iseek= n seek .IR n "" input records before starting copy .br .ns .TP .RI files= n copy .I n files from (tape) input .br .ns .TP .RI seek= n seek .I n records from beginning of output file before copying .br .ns .TP .RI oseek= n same as seek .br .ns .TP count=\fIn\fR copy only .IR n "" input records .br .ns .TP conv=ascii .ds h \h'\w'conv='u' convert EBCDIC to ASCII .br .ns .IP \*hebcdic convert ASCII to EBCDIC .br .ns .IP \*hibm slightly different map of ASCII to EBCDIC .br .ns .IP \*hblock convert newline-terminated input lines to blocks .br .ns .IP \*hunblock convert blocked input to lines .br .ns .IP \*hlcase map alphabetics to lower case .br .ns .IP \*hucase map alphabetics to upper case .br .ns .IP \*hswab swap every pair of bytes .br .ns .IP \*hnoerror do not stop processing on an error .br .ns .IP \*hnotrunc do not truncate the output file .br .ns .IP \*hsync pad every input record to .I ibs .br .ns .IP "\*h... , ..." several comma-separated conversions .PP .fi Where sizes are specified, a number of bytes is expected. A number may end with .B "k, b" or .B w to specify multiplication by 1024, 512, or 2 respectively; a pair of numbers may be separated by .B x to indicate a product. .PP .I Cbs is used only if .IR ascii , .IR unblock, .IR ebcdic , .IR ibm , or .IR block conversion is specified. In the first two cases, .I cbs bytes are placed into the conversion buffer, converted to ASCII, and trailing blanks trimmed and new-line added before sending the line to the output. In the latter three cases, ASCII characters (bytes) are read into the conversion buffer, converted to EBCDIC, and blanks added to make up an output record of size .IR cbs . .PP Two additional values for the `conv' option, `conv=idirect' and `conv=odirect', are available as extensions. They enable direct i/o on input or output, respectively. See the description of the `O_DIRECT' flag in .IR open (2) for more information. `conv=odirect' must be used with care as it requires padding for correct operation; a write that is not a multiple of an acceptable buffer size will fail. This is particularly of concern for the last block written. Using `conv=odirect' thus usually requires `conv=sync' and cannot be used if such padding destroys the file integrity. .PP After completion, .I dd reports the number of whole and partial input and output blocks. .SH "ENVIRONMENT VARIABLES" .TP .BR LANG ", " LC_ALL See .IR locale (7). .TP .B LC_CTYPE Determines the mapping of bytes to characters for `conv=lcase' and `conv=ucase'. .SH EXAMPLES To read an EBCDIC tape blocked ten 80-byte EBCDIC card images per record into the ASCII file .IR x : .IP "" dd if=/dev/rmt0 of=x ibs=800 cbs=80 conv=ascii,lcase .PP Note the use of raw magtape. .I Dd is especially suited to I/O on the raw physical devices because it allows reading and writing in arbitrary record sizes. .PP To skip over a file before copying from magnetic tape do .IP "" (dd of=/dev/null; dd of=x)