Print this page
    
OS-4 libiscsit: several leaks due to left "errlist"
OS-199 keep your tree clean
    
      
        | Split | 
	Close | 
      
      | Expand all | 
      | Collapse all | 
    
    
          --- old/usr/src/man/man1m/dd.1m
          +++ new/usr/src/man/man1m/dd.1m
   1    1  .\"
   2    2  .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
   3    3  .\" permission to reproduce portions of its copyrighted documentation.
   4    4  .\" Original documentation from The Open Group can be obtained online at
   5    5  .\" http://www.opengroup.org/bookstore/.
   6    6  .\"
   7    7  .\" The Institute of Electrical and Electronics Engineers and The Open
   8    8  .\" Group, have given us permission to reprint portions of their
   9    9  .\" documentation.
  10   10  .\"
  11   11  .\" In the following statement, the phrase ``this text'' refers to portions
  12   12  .\" of the system documentation.
  13   13  .\"
  14   14  .\" Portions of this text are reprinted and reproduced in electronic form
  15   15  .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
  16   16  .\" Standard for Information Technology -- Portable Operating System
  17   17  .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
  18   18  .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
  19   19  .\" Engineers, Inc and The Open Group.  In the event of any discrepancy
  20   20  .\" between these versions and the original IEEE and The Open Group
  21   21  .\" Standard, the original IEEE and The Open Group Standard is the referee
  22   22  .\" document.  The original Standard can be obtained online at
  23   23  .\" http://www.opengroup.org/unix/online.html.
  24   24  .\"
  25   25  .\" This notice shall appear on any product containing this material.
  26   26  .\"
  27   27  .\" The contents of this file are subject to the terms of the
  28   28  .\" Common Development and Distribution License (the "License").
  29   29  .\" You may not use this file except in compliance with the License.
  30   30  .\"
  31   31  .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  32   32  .\" or http://www.opensolaris.org/os/licensing.
  33   33  .\" See the License for the specific language governing permissions
  34   34  .\" and limitations under the License.
  35   35  .\"
  36   36  .\" When distributing Covered Code, include this CDDL HEADER in each
  37   37  .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  38   38  .\" If applicable, add the following below this CDDL HEADER, with the
  39   39  .\" fields enclosed by brackets "[]" replaced with your own identifying
  40   40  .\" information: Portions Copyright [yyyy] [name of copyright owner]
  41   41  .\"
  42   42  .\"
  43   43  .\" Copyright 1989 AT&T
  44   44  .\" Copyright (c) 1992, X/Open Company Limited  All Rights Reserved
  45   45  .\" Portions Copyright (c) 1995, Sun Microsystems, Inc.  All Rights Reserved
  46   46  .\" Copyright (c) 2014, Joyent, Inc.  All rights Reserved.
  47   47  .\" Copyright (c) 2014 by Delphix. All rights reserved.
  48   48  .\"
  49   49  .TH DD 1M "Dec 12, 2014"
  50   50  .SH NAME
  51   51  dd \- convert and copy a file
  52   52  .SH SYNOPSIS
  53   53  .LP
  54   54  .nf
  55   55  \fB/usr/bin/dd\fR [\fIoperand=value\fR]...
  56   56  .fi
  57   57  
  58   58  .SH DESCRIPTION
  59   59  .LP
  60   60  The \fBdd\fR utility copies the specified input file to the specified output
  61   61  with possible conversions. The standard input and output are used by default.
  62   62  The input and output block sizes may be specified to take advantage of raw
  63   63  physical I/O. Sizes are specified in bytes; a number may end with \fBk\fR,
  64   64  \fBb\fR, or \fBw\fR to specify multiplication by 1024, 512, or 2, respectively.
  65   65  Numbers may also be separated by \fBx\fR to indicate multiplication.
  66   66  .sp
  67   67  .LP
  68   68  The \fBdd\fR utility reads the input one block at a time, using the specified
  69   69  input block size. \fBdd\fR then processes the block of data actually returned,
  70   70  which could be smaller than the requested block size. \fBdd\fR applies any
  71   71  conversions that have been specified and writes the resulting data to the
  72   72  output in blocks of the specified output block size.
  73   73  .sp
  74   74  .LP
  75   75  \fBcbs\fR is used only if \fBascii\fR, \fBasciib\fR, \fBunblock\fR,
  76   76  \fBebcdic\fR, \fBebcdicb\fR, \fBibm\fR, \fBibmb\fR, or \fBblock\fR conversion
  77   77  is specified. In the first two cases, \fBcbs\fR characters are copied into the
  78   78  conversion buffer, any specified character mapping is done, trailing blanks are
  79   79  trimmed, and a \fBNEWLINE\fR is added before sending the line to output. In the
  80   80  last three cases, characters up to \fBNEWLINE\fR are read into the conversion
  81   81  buffer and blanks are added to make up an output record of size \fBcbs\fR.
  82   82  \fBASCII\fR files are presumed to contain \fBNEWLINE\fR characters. If
  83   83  \fBcbs\fR is unspecified or \fB0\fR, the \fBascii\fR, \fBasciib\fR,
  84   84  \fBebcdic\fR, \fBebcdicb\fR, \fBibm\fR, and \fBibmb\fR options convert the
  85   85  character set without changing the input file's block structure. The
  86   86  \fBunblock\fR and \fBblock\fR options become a simple file copy.
  87   87  .sp
  88   88  .LP
  89   89  After completion, \fBdd\fR reports the number of whole and partial input and
  90   90  output blocks.
  91   91  .SH OPERANDS
  92   92  .LP
  93   93  The following operands are supported:
  94   94  .sp
  95   95  .ne 2
  96   96  .na
  97   97  \fB\fBif=\fR\fIfile\fR\fR
  98   98  .ad
  99   99  .sp .6
 100  100  .RS 4n
 101  101  Specifies the input path. Standard input is the default.
 102  102  .RE
 103  103  
 104  104  .sp
 105  105  .ne 2
 106  106  .na
 107  107  \fB\fBof=\fR\fIfile\fR\fR
 108  108  .ad
 109  109  .sp .6
 110  110  .RS 4n
 111  111  Specifies the output path. Standard output is the default. If the
 112  112  \fBseek=\fR\fBexpr\fR conversion is not also specified, the output file will be
 113  113  truncated before the copy begins, unless \fBconv=notrunc\fR is specified. If
 114  114  \fBseek=\fR\fBexpr\fR is specified, but \fBconv=notrunc\fR is not, the effect
 115  115  of the copy will be to preserve the blocks in the output file over which
 116  116  \fBdd\fR seeks, but no other portion of the output file will be preserved. (If
 117  117  the size of the seek plus the size of the input file is less than the previous
 118  118  size of the output file, the output file is shortened by the copy.)
 119  119  .RE
 120  120  
 121  121  .sp
 122  122  .ne 2
 123  123  .na
 124  124  \fB\fBibs=\fR\fIn\fR\fR
 125  125  .ad
 126  126  .sp .6
 127  127  .RS 4n
 128  128  Specifies the input block size in \fIn\fR bytes (default is \fB512\fR).
 129  129  .RE
 130  130  
 131  131  .sp
 132  132  .ne 2
 133  133  .na
 134  134  \fB\fBobs=\fR\fIn\fR\fR
 135  135  .ad
 136  136  .sp .6
 137  137  .RS 4n
 138  138  Specifies the output block size in \fIn\fR bytes (default is \fB512\fR).
 139  139  .RE
 140  140  
 141  141  .sp
 142  142  .ne 2
 143  143  .na
 144  144  \fB\fBbs=\fR\fIn\fR\fR
 145  145  .ad
 146  146  .sp .6
 147  147  .RS 4n
 148  148  Sets both input and output block sizes to \fIn\fR bytes, superseding \fBibs=\fR
 149  149  and \fBobs=\fR. If no conversion other than \fBsync\fR,\fB noerror\fR, and
 150  150  \fBnotrunc\fR is specified, each input block is copied to the output as a
 151  151  single block without aggregating short blocks.
 152  152  .RE
 153  153  
 154  154  .sp
 155  155  .ne 2
 156  156  .na
 157  157  \fB\fBcbs=\fR\fIn\fR\fR
 158  158  .ad
 159  159  .sp .6
 160  160  .RS 4n
 161  161  Specifies the conversion block size for \fBblock\fR and \fBunblock\fR in bytes
 162  162  by \fIn\fR (default is \fB0\fR). If \fBcbs=\fR is omitted or given a value of
 163  163  \fB0\fR, using \fBblock\fR or \fBunblock\fR produces unspecified results.
 164  164  .sp
 165  165  This option is used only if \fBASCII\fR or \fBEBCDIC\fR conversion is
 166  166  specified. For the \fBascii\fR and \fBasciib\fR operands, the input is handled
 167  167  as described for the \fBunblock\fR operand except that characters are converted
 168  168  to \fBASCII\fR before the trailing \fBSPACE\fR characters are deleted. For the
 169  169  \fBebcdic\fR, \fBebcdicb\fR, \fBibm\fR, and \fBibmb\fR operands, the input is
 170  170  handled as described for the \fBblock\fR operand except that the characters are
 171  171  converted to \fBEBCDIC\fR or IBM \fBEBCDIC\fR after the trailing \fBSPACE\fR
 172  172  characters are added.
 173  173  .RE
 174  174  
 175  175  .sp
 176  176  .ne 2
 177  177  .na
 178  178  \fB\fBfiles=\fR\fIn\fR\fR
 179  179  .ad
 180  180  .sp .6
 181  181  .RS 4n
 182  182  Copies and concatenates \fIn\fR input files before terminating (makes sense
 183  183  only where input is a magnetic tape or similar device).
 184  184  .RE
 185  185  
 186  186  .sp
 187  187  .ne 2
 188  188  .na
 189  189  \fB\fBskip=\fR\fIn\fR\fR
 190  190  .ad
 191  191  .sp .6
 192  192  .RS 4n
 193  193  Skips \fIn\fR input blocks (using the specified input block size) before
 194  194  starting to copy. On seekable files, the implementation reads the blocks or
 195  195  seeks past them. On non-seekable files, the blocks are read and the data is
 196  196  discarded.
 197  197  .RE
 198  198  
 199  199  .sp
 200  200  .ne 2
 201  201  .na
 202  202  \fB\fBiseek=\fR\fIn\fR\fR
 203  203  .ad
 204  204  .sp .6
 205  205  .RS 4n
 206  206  Seeks \fIn\fR blocks from beginning of input file before copying (appropriate
 207  207  for disk files, where \fBskip\fR can be incredibly slow).
 208  208  .RE
 209  209  
 210  210  .sp
 211  211  .ne 2
 212  212  .na
 213  213  \fB\fBoseek=\fR\fIn\fR\fR
 214  214  .ad
 215  215  .sp .6
 216  216  .RS 4n
 217  217  Seeks \fIn\fR blocks from beginning of output file before copying.
 218  218  .RE
 219  219  
 220  220  .sp
 221  221  .ne 2
 222  222  .na
 223  223  \fB\fBseek=\fR\fIn\fR\fR
 224  224  .ad
 225  225  .sp .6
 226  226  .RS 4n
 227  227  Skips \fIn\fR blocks (using the specified output block size) from beginning of
 228  228  output file before copying. On non-seekable files, existing blocks are read and
 229  229  space from the current end-of-file to the specified offset, if any, is filled
 230  230  with null bytes. On seekable files, the implementation seeks to the specified
 231  231  offset or reads the blocks as described for non-seekable files.
 232  232  .RE
 233  233  
 234  234  .sp
 235  235  .ne 2
 236  236  .na
 237  237  \fB\fBostride=\fR\fIn\fR\fR
 238  238  .ad
 239  239  .sp .6
 240  240  .RS 4n
 241  241  Writes every \fIn\fRth block (using the specified output block size) when
 242  242  writing output.  Skips \fIn\fR - 1 blocks after writing each record.
 243  243  .RE
 244  244  
 245  245  .sp
 246  246  .ne 2
 247  247  .na
 248  248  \fB\fBistride=\fR\fIn\fR\fR
 249  249  .ad
 250  250  .sp .6
 251  251  .RS 4n
 252  252  Reads every \fIn\fRth block (using the specified input block size) when
 253  253  reading input.  Skips \fIn\fR - 1 blocks after reading each record.
 254  254  .RE
 255  255  
 256  256  .sp
 257  257  .ne 2
 258  258  .na
 259  259  \fB\fBstride=\fR\fIn\fR\fR
 260  260  .ad
 261  261  .sp .6
 262  262  .RS 4n
 263  263  Reads every \fIn\fRth block (using the specified input block size) when
 264  264  reading input.  Skips \fIn\fR - 1 blocks after reading each record.  Also
 265  265  writes every \fIn\fRth block (using the specified output block size) when
 266  266  writing output.  Skips \fIn\fR - 1 blocks after writing each record.
 267  267  .RE
 268  268  
 269  269  .sp
 270  270  .ne 2
 271  271  .na
 272  272  \fB\fBcount=\fR\fIn\fR\fR
 273  273  .ad
 274  274  .sp .6
 275  275  .RS 4n
 276  276  Copies only \fIn\fR input blocks.
 277  277  .RE
 278  278  
 279  279  .sp
 280  280  .ne 2
 281  281  .na
 282  282  \fB\fBconv=\fR\fIvalue\fR[\fB,\fR\fIvalue\fR.\|.\|.\|]\fR
 283  283  .ad
 284  284  .sp .6
 285  285  .RS 4n
 286  286  Where \fIvalue\fRs are comma-separated symbols from the following list:
 287  287  .sp
 288  288  .ne 2
 289  289  .na
 290  290  \fB\fBascii\fR\fR
 291  291  .ad
 292  292  .RS 11n
 293  293  Converts \fBEBCDIC\fR to \fBASCII\fR.
 294  294  .RE
 295  295  
 296  296  .sp
 297  297  .ne 2
 298  298  .na
 299  299  \fB\fBasciib\fR\fR
 300  300  .ad
 301  301  .RS 11n
 302  302  Converts \fBEBCDIC\fR to \fBASCII\fR using \fBBSD\fR-compatible character
 303  303  translations.
 304  304  .RE
 305  305  
 306  306  .sp
 307  307  .ne 2
 308  308  .na
 309  309  \fB\fBebcdic\fR\fR
 310  310  .ad
 311  311  .RS 11n
 312  312  Converts \fBASCII\fR to \fBEBCDIC\fR. If converting fixed-length \fBASCII\fR
 313  313  records without NEWLINEs, sets up a pipeline with \fBdd conv=unblock\fR
 314  314  beforehand.
 315  315  .RE
 316  316  
 317  317  .sp
 318  318  .ne 2
 319  319  .na
 320  320  \fB\fBebcdicb\fR\fR
 321  321  .ad
 322  322  .RS 11n
 323  323  Converts \fBASCII\fR to \fBEBCDIC\fR using \fBBSD\fR-compatible character
 324  324  translations. If converting fixed-length \fBASCII\fR records without
 325  325  \fBNEWLINE\fRs, sets up a pipeline with \fBdd conv=unblock\fR beforehand.
 326  326  .RE
 327  327  
 328  328  .sp
 329  329  .ne 2
 330  330  .na
 331  331  \fB\fBibm\fR\fR
 332  332  .ad
 333  333  .RS 11n
 334  334  Slightly different map of \fBASCII\fR to \fBEBCDIC\fR. If converting
 335  335  fixed-length \fBASCII\fR records without \fBNEWLINE\fRs, sets up a pipeline
 336  336  with \fBdd conv=unblock\fR beforehand.
 337  337  .RE
 338  338  
 339  339  .sp
 340  340  .ne 2
 341  341  .na
 342  342  \fB\fBibmb\fR\fR
 343  343  .ad
 344  344  .RS 11n
 345  345  Slightly different map of \fBASCII\fR to \fBEBCDIC\fR using
 346  346  \fBBSD\fR-compatible character translations. If converting fixed-length
 347  347  \fBASCII\fR records without \fBNEWLINE\fRs, sets up a pipeline with \fBdd
 348  348  conv=unblock\fR beforehand.
 349  349  .RE
 350  350  
 351  351  The \fBascii\fR (or \fBasciib\fR), \fBebcdic\fR (or \fBebcdicb\fR), and
 352  352  \fBibm\fR (or \fBibmb\fR) values are mutually exclusive.
 353  353  .sp
 354  354  .ne 2
 355  355  .na
 356  356  \fB\fBblock\fR\fR
 357  357  .ad
 358  358  .RS 11n
 359  359  Treats the input as a sequence of \fBNEWLINE\fR-terminated or
 360  360  \fBEOF\fR-terminated variable-length records independent of the input block
 361  361  boundaries. Each record is converted to a record with a fixed length specified
 362  362  by the conversion block size. Any \fBNEWLINE\fR character is removed from the
 363  363  input line. \fBSPACE\fR characters are appended to lines that are shorter than
 364  364  their conversion block size to fill the block. Lines that are longer than the
 365  365  conversion block size are truncated to the largest number of characters that
 366  366  will fit into that size. The number of truncated lines is reported.
 367  367  .RE
 368  368  
 369  369  .sp
 370  370  .ne 2
 371  371  .na
 372  372  \fB\fBunblock\fR\fR
 373  373  .ad
 374  374  .RS 11n
 375  375  Converts fixed-length records to variable length. Reads a number of bytes equal
 376  376  to the conversion block size (or the number of bytes remaining in the input, if
 377  377  less than the conversion block size), delete all trailing \fBSPACE\fR
 378  378  characters, and append a \fBNEWLINE\fR character.
 379  379  .RE
 380  380  
 381  381  The  \fBblock\fR and \fBunblock\fR values are mutually exclusive.
 382  382  .sp
 383  383  .ne 2
 384  384  .na
 385  385  \fB\fBlcase\fR\fR
 386  386  .ad
 387  387  .RS 9n
 388  388  Maps upper-case characters specified by the \fBLC_CTYPE\fR keyword
 389  389  \fBtolower\fR to the corresponding lower-case character. Characters for which
 390  390  no mapping is specified are not modified by this conversion.
 391  391  .RE
 392  392  
 393  393  .sp
 394  394  .ne 2
 395  395  .na
 396  396  \fB\fBucase\fR\fR
 397  397  .ad
 398  398  .RS 9n
 399  399  Maps lower-case characters specified by the \fBLC_CTYPE\fR keyword
 400  400  \fBtoupper\fR to the corresponding upper-case character. Characters for which
 401  401  no mapping is specified are not modified by this conversion.
 402  402  .RE
 403  403  
 404  404  The \fBlcase\fR and \fBucase\fR symbols are mutually exclusive.
 405  405  .sp
 406  406  .ne 2
 407  407  .na
 408  408  \fB\fBswab\fR\fR
 409  409  .ad
 410  410  .RS 11n
 411  411  Swaps every pair of input bytes. If the current input record is an odd number
 412  412  of bytes, the last byte in the input record is ignored.
 413  413  .RE
 414  414  
 415  415  .sp
 416  416  .ne 2
 417  417  .na
 418  418  \fB\fBnoerror\fR\fR
 419  419  .ad
 420  420  .RS 11n
 421  421  Does not stop processing on an input error. When an input error occurs, a
 422  422  diagnostic message is written on standard error, followed by the current input
 423  423  and output block counts in the same format as used at completion. If the
 424  424  \fBsync\fR conversion is specified, the missing input is replaced with null
 425  425  bytes and processed normally. Otherwise, the input block will be omitted from
 426  426  the output.
 427  427  .RE
 428  428  
 429  429  .sp
 430  430  .ne 2
 431  431  .na
 432  432  \fB\fBnotrunc\fR\fR
 433  433  .ad
 434  434  .RS 11n
 435  435  Does not truncate the output file. Preserves blocks in the output file not
 436  436  explicitly written by this invocation of \fBdd\fR. (See also the preceding
 437  437  \fBof=\fR\fIfile\fR operand.)
 438  438  .RE
 439  439  
 440  440  .sp
  
    | 
      ↓ open down ↓ | 
    440 lines elided | 
    
      ↑ open up ↑ | 
  
 441  441  .ne 2
 442  442  .na
 443  443  \fB\fBsync\fR\fR
 444  444  .ad
 445  445  .RS 11n
 446  446  Pads every input block to the size of the \fBibs=\fR buffer, appending null
 447  447  bytes. (If either \fBblock\fR or \fBunblock\fR is also specified, appends
 448  448  \fBSPACE\fR characters, rather than null bytes.)
 449  449  .RE
 450  450  
 451      -.RE
 452      -
 453  451  .sp
 454  452  .ne 2
 455  453  .na
 456  454  \fB\fBoflag=\fR\fIvalue\fR[\fB,\fR\fIvalue\fR.\|.\|.\|]\fR
 457  455  .ad
 458  456  .sp .6
 459  457  Where \fIvalue\fRs are comma-separated symbols from the following list which
 460  458  affect the behavior of writing the output file:
 461  459  .sp
 462  460  .ne 2
 463  461  .na
 464  462  \fB\fBdsync\fR\fR
 465  463  .ad
 466  464  .RS 11n
 467  465  The output file is opened with the \fBO_DSYNC\fR flag set. All data writes will
 468  466  be synchronous. For more information on \fBO_DSYNC\fR see \fBfcntl.h\fR(3HEAD).
 469  467  .RE
 470  468  
 471  469  .sp
 472  470  .ne 2
 473  471  .na
 474  472  \fB\fBsync\fR\fR
 475  473  .ad
 476  474  .RS 11n
 477  475  The output file is opened with the \fBO_SYNC\fR flag set. All data and metadata
 478  476  writes will be synchronous. For more information on \fBO_SYNC\fR see
 479  477  \fBfcntl.h\fR(3HEAD).
 480  478  .RE
 481  479  
 482  480  .sp
 483  481  .LP
 484  482  If operands other than \fBconv=\fR and \fBoflag=\fR are specified more than once,
 485  483  the last specified \fBoperand=\fR\fIvalue\fR is used.
 486  484  .sp
 487  485  .LP
 488  486  For the \fBbs=\fR, \fBcbs=\fR, \fBibs=\fR, and \fBobs=\fR operands, the
 489  487  application must supply an expression specifying a size in bytes. The
 490  488  expression, \fBexpr\fR, can be:
 491  489  .RS +4
 492  490  .TP
 493  491  1.
 494  492  a positive decimal number
 495  493  .RE
 496  494  .RS +4
 497  495  .TP
 498  496  2.
 499  497  a positive decimal number followed by \fBk\fR, specifying multiplication by
 500  498  1024
 501  499  .RE
 502  500  .RS +4
 503  501  .TP
 504  502  3.
 505  503  a positive decimal number followed by \fBM\fR, specifying multiplication by
 506  504  1024*1024
 507  505  .RE
 508  506  .RS +4
 509  507  .TP
 510  508  4.
 511  509  a positive decimal number followed by \fBG\fR, specifying multiplication by
 512  510  1024*1024*1024
 513  511  .RE
 514  512  .RS +4
 515  513  .TP
 516  514  5.
 517  515  a positive decimal number followed by \fBT\fR, specifying multiplication by
 518  516  1024*1024*1024*1024
 519  517  .RE
 520  518  .RS +4
 521  519  .TP
 522  520  6.
 523  521  a positive decimal number followed by \fBP\fR, specifying multiplication by
 524  522  1024*1024*1024*1024*1024
 525  523  .RE
 526  524  .RS +4
 527  525  .TP
 528  526  7.
 529  527  a positive decimal number followed by \fBE\fR, specifying multiplication by
 530  528  1024*1024*1024*1024*1024*1024
 531  529  .RE
 532  530  .RS +4
 533  531  .TP
 534  532  8.
 535  533  a positive decimal number followed by \fBZ\fR, specifying multiplication by
 536  534  1024*1024*1024*1024*1024*1024*1024
 537  535  .RE
 538  536  .RS +4
 539  537  .TP
 540  538  9.
 541  539  a positive decimal number followed by \fBb\fR, specifying multiplication by
 542  540  512
 543  541  .RE
 544  542  .RS +4
 545  543  .TP
 546  544  10.
 547  545  two or more positive decimal numbers (with or without \fBk\fR or \fBb\fR)
 548  546  separated by \fBx\fR, specifying the product of the indicated values.
 549  547  .RE
 550  548  .sp
 551  549  .LP
 552  550  All of the operands will be processed before any input is read.
 553  551  .SH SIGNALS
 554  552  .LP
 555  553  When \fBdd\fR receives either SIGINFO or SIGUSR1, \fBdd\fR will emit the current
 556  554  input and output block counts, total bytes written, total time elapsed, and the
 557  555  number of bytes per second to standard error. This is the same information
 558  556  format that \fBdd\fR emits when it successfully completes. Users may send
 559  557  SIGINFO via their terminal. The default character is ^T, see \fBstty\fR(1) for
 560  558  more information.
 561  559  .sp
 562  560  .LP
 563  561  For \fBSIGINT\fR, \fBdd\fR writes status information to standard error before
 564  562  exiting. \fBdd\fR takes the standard action for all other signals.
 565  563  
 566  564  .SH USAGE
 567  565  .LP
 568  566  See \fBlargefile\fR(5) for the description of the behavior of \fBdd\fR when
 569  567  encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
 570  568  .SH EXAMPLES
 571  569  .LP
 572  570  \fBExample 1 \fRCopying from one tape drive to another
 573  571  .sp
 574  572  .LP
 575  573  The following example copies from tape drive \fB0\fR to tape drive \fB1\fR,
 576  574  using a common historical device naming convention.
 577  575  
 578  576  .sp
 579  577  .in +2
 580  578  .nf
 581  579  example% \fBdd if=/dev/rmt/0h  of=/dev/rmt/1h\fR
 582  580  .fi
 583  581  .in -2
 584  582  .sp
 585  583  
 586  584  .LP
 587  585  \fBExample 2 \fRStripping the first 10 bytes from standard input
 588  586  .sp
 589  587  .LP
 590  588  The following example strips the first 10 bytes from standard input:
 591  589  
 592  590  .sp
 593  591  .in +2
 594  592  .nf
 595  593  example% \fBdd ibs=10  skip=1\fR
 596  594  .fi
 597  595  .in -2
 598  596  .sp
 599  597  
 600  598  .LP
 601  599  \fBExample 3 \fRReading a tape into an ASCII file
 602  600  .sp
 603  601  .LP
 604  602  This example reads an \fBEBCDIC\fR tape blocked ten 80-byte \fBEBCDIC\fR card
 605  603  images per block into the \fBASCII\fR file \fBx\fR:
 606  604  
 607  605  .sp
 608  606  .in +2
 609  607  .nf
 610  608  example% \fBdd if=/dev/tape of=x ibs=800 cbs=80 conv=ascii,lcase\fR
 611  609  .fi
 612  610  .in -2
 613  611  .sp
 614  612  
 615  613  .LP
 616  614  \fBExample 4 \fRUsing conv=sync to write to tape
 617  615  .sp
 618  616  .LP
 619  617  The following example uses \fBconv=sync\fR when writing to a tape:
 620  618  
 621  619  .sp
 622  620  .in +2
 623  621  .nf
 624  622  example% \fBtar cvf - . | compress | dd obs=1024k of=/dev/rmt/0 conv=sync\fR
 625  623  .fi
 626  624  .in -2
 627  625  .sp
 628  626  
 629  627  .SH ENVIRONMENT VARIABLES
 630  628  .LP
 631  629  See \fBenviron\fR(5) for descriptions of the following environment variables
 632  630  that affect the execution of \fBdd\fR: \fBLANG\fR, \fBLC_ALL\fR,
 633  631  \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
 634  632  .SH EXIT STATUS
 635  633  .LP
 636  634  The following exit values are returned:
 637  635  .sp
 638  636  .ne 2
 639  637  .na
 640  638  \fB\fB0\fR\fR
 641  639  .ad
 642  640  .RS 6n
 643  641  The input file was copied successfully.
 644  642  .RE
 645  643  
 646  644  .sp
 647  645  .ne 2
 648  646  .na
 649  647  \fB\fB>0\fR\fR
 650  648  .ad
 651  649  .RS 6n
 652  650  An error occurred.
 653  651  .RE
 654  652  
 655  653  .sp
 656  654  .LP
 657  655  If an input error is detected and the \fBnoerror\fR conversion has not been
 658  656  specified, any partial output block will be written to the output file, a
 659  657  diagnostic message will be written, and the copy operation will be
 660  658  discontinued. If some other error is detected, a diagnostic message will be
 661  659  written and the copy operation will be discontinued.
 662  660  .SH ATTRIBUTES
 663  661  .LP
 664  662  See \fBattributes\fR(5) for descriptions of the following attributes:
 665  663  .sp
 666  664  
 667  665  .sp
 668  666  .TS
 669  667  box;
 670  668  c | c
 671  669  l | l .
 672  670  ATTRIBUTE TYPE  ATTRIBUTE VALUE
 673  671  _
 674  672  Interface Stability     Standard
 675  673  .TE
 676  674  
 677  675  .SH SEE ALSO
 678  676  .LP
 679  677  \fBcp\fR(1), \fBsed\fR(1), \fBtr\fR(1), \fBfcntl.h\fR(3HEAD),
 680  678  \fBattributes\fR(5), \fBenviron\fR(5), \fBlargefile\fR(5), \fBstandards\fR(5)
 681  679  .SH DIAGNOSTICS
 682  680  .ne 2
 683  681  .na
 684  682  \fB\fBf+p records in(out)\fR\fR
 685  683  .ad
 686  684  .RS 23n
 687  685  numbers of full and partial blocks read(written)
 688  686  .RE
 689  687  
 690  688  .SH NOTES
 691  689  .LP
 692  690  Do not use \fBdd\fR to copy files between file systems having different block
 693  691  sizes.
 694  692  .sp
 695  693  .LP
 696  694  Using a  blocked device to copy a file will result in extra nulls being added
 697  695  to the file to pad the final block to the block boundary.
 698  696  .sp
 699  697  .LP
 700  698  When  \fBdd\fR reads from a pipe, using the  \fBibs=X\fR and  \fBobs=Y\fR
 701  699  operands, the output will always be blocked in chunks of size Y. When
 702  700  \fBbs=Z\fR is used, the output blocks will be whatever was available to be read
 703  701  from the pipe at the time.
 704  702  .sp
 705  703  .LP
 706  704  When using \fBdd\fR to copy files to a tape device, the file size must be a
 707  705  multiple of the device sector size (for example, 512 Kbyte).  To  copy files of
 708  706  arbitrary size to a tape device, use  \fBtar\fR(1) or  \fBcpio\fR(1).
  
    | 
      ↓ open down ↓ | 
    246 lines elided | 
    
      ↑ open up ↑ | 
  
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX