1.\" Copyright (c) 1990, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" This code is derived from software contributed to Berkeley by 5.\" Keith Muller of the University of California, San Diego. 6.\" 7.\" Redistribution and use in source and binary forms, with or without 8.\" modification, are permitted provided that the following conditions --- 19 unchanged lines hidden (view full) --- 28.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33.\" SUCH DAMAGE. 34.\" 35.\" @(#)dd.1 8.2 (Berkeley) 1/13/94 |
36.\" $Id: dd.1,v 1.6 1997/10/11 20:09:04 joerg Exp $ |
37.\" 38.Dd January 13, 1994 39.Dt DD 1 40.Os 41.Sh NAME 42.Nm dd 43.Nd convert and copy a file 44.Sh SYNOPSIS 45.Nm dd 46.Op operands ... 47.Sh DESCRIPTION 48The 49.Nm 50utility copies the standard input to the standard output. 51Input data is read and written in 512-byte blocks. 52If input reads are short, input from multiple reads are aggregated 53to form the output block. 54When finished, |
55.Nm |
56displays the number of complete and partial input and output blocks 57and truncated input records to the standard error output. 58.Pp 59The following operands are available: 60.Bl -tag -width of=file 61.It Cm bs= Ns Ar n 62Set both input and output block size, superseding the 63.Cm ibs --- 168 unchanged lines hidden (view full) --- 232conversion is not specified, the input block is omitted from the output. 233On input files which are not tapes or pipes, the file offset 234will be positioned past the block in which the error occurred using 235.Xr lseek 2 . 236.It Cm notrunc 237Do not truncate the output file. 238This will preserve any blocks in the output file not explicitly written 239by |
240.Nm Ns . |
241The 242.Cm notrunc 243value is not supported for tapes. 244.It Cm osync 245Pad the final output block to the full output block size. 246If the input file is not a multiple of the output block size 247after conversion, this conversion forces the final output block 248to be the same size as preceding blocks for use on devices that require --- 33 unchanged lines hidden (view full) --- 282.Pp 283Where sizes are specified, a decimal number of bytes is expected. 284If the number ends with a ``b'', ``k'', ``m'' or ``w'', the number 285is multiplied by 512, 1024 (1K), 1048576 (1M) or the number of bytes 286in an integer, respectively. 287Two or more numbers may be separated by an ``x'' to indicate a product. 288.Pp 289When finished, |
290.Nm |
291displays the number of complete and partial input and output blocks, 292truncated input records and odd-length byte-swapping blocks to the 293standard error output. 294A partial input block is one where less than the input block size 295was read. 296A partial output block is one where less than the output block size 297was written. 298Partial output blocks to tape devices are considered fatal errors. --- 6 unchanged lines hidden (view full) --- 305Normally, data resulting from input or conversion or both are aggregated 306into output blocks of the specified size. 307After the end of input is reached, any remaining output is written as 308a block. 309This means that the final output block may be shorter than the output 310block size. 311.Pp 312If |
313.Nm |
314receives a 315.Dv SIGINFO 316(see the ``status'' argument for 317.Xr stty 1 ) 318signal, the current input and output block counts will 319be written to the standard error output 320in the same format as the standard completion message. 321If |
322.Nm |
323receives a 324.Dv SIGINT 325signal, the current input and output block counts will 326be written to the standard error output 327in the same format as the standard completion message and |
328.Nm |
329will exit. 330.Pp 331The |
332.Nm |
333utility exits 0 on success and >0 if an error occurred. 334.Sh SEE ALSO 335.Xr cp 1 , 336.Xr mt 1 , 337.Xr tr 1 338.Sh STANDARDS 339The |
340.Nm |
341utility is expected to be a superset of the 342.St -p1003.2 343standard. 344The 345.Cm files 346operand and the 347.Cm ascii , 348.Cm ebcdic , 349.Cm ibm , 350.Cm oldascii , 351.Cm oldebcdic 352and 353.Cm oldibm 354values are extensions to the 355.Tn POSIX 356standard. |