⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dd.html

📁 unix 下的C开发手册,还用详细的例程。
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>dd</title></head><body bgcolor=white><center><font size=2>The Single UNIX &reg; Specification, Version 2<br>Copyright &copy; 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_001_014_358">&nbsp;</a>NAME</h4><blockquote>dd - convert and copy a file</blockquote><h4><a name = "tag_001_014_359">&nbsp;</a>SYNOPSIS</h4><blockquote><pre><code>dd <b>[</b><i>operand</i> ...<b>]</b></code></pre></blockquote><h4><a name = "tag_001_014_360">&nbsp;</a>DESCRIPTION</h4><blockquote>The<i>dd</i>utility will copy the specified input file to the specifiedoutput file with possible conversions using specific input andoutput block sizes.It will read the input one block at a time,using the specified input block size; it then will process theblock of data actually returned, which could be smaller than therequested block size.It will apply any conversions that have beenspecified and write the resulting data to the output in blocksof the specified output block size.If the<bs>bs=</b>exproperand is specified and no conversions other than<b>sync</b>,<b>noerror</b>or<b>notrunc</b>are requested, the data returned from each input block will be writtenas a separate output block;if the read returns less than a fullblock and the<b>sync</b>conversion is not specified, the resultingoutput block will be the same size as the input block.If the<b>bs=</b>exproperand is not specified, or a conversion other than<b>sync</b>,<b>noerror</b>or notruncis requested, the input will be processed andcollected into full-sized output blocks until the end of theinput is reached.<p>The processing order is as follows:<ol><p><li>An input block is read.<p><li>If the input block is shorter than the specified input blocksize and the<b>sync</b>conversion is specified, nullbytes are appended to the input data up to the specified size.(If either<b>block</b>or<b>unblock</b>is also specified,spacecharacters are appended instead of null bytes.)The remaining conversions and output include the padcharacters as if they had been read from the input.<p><li>If the<b>bs=</b>exproperand is specified and no conversion other than<b>sync</b>or<b>noerror</b>is requested, the resulting datawill be written to the output as a single block, and theremaining steps are omitted.<p><li>If the<b>swab</b>conversion is specified, each pair of input data bytes will be swapped.If there is an odd number of bytesin the input block, the results are unspecified.<p><li>Any remaining conversions(<b>block</b>,<b>unblock</b>,<b>lcase</b>and<b>ucase</b>)will be performed.These conversions will operate on the inputdata independently of the input blocking; an input or outputfixed-length record may span block boundaries.<p><li>The data resulting from input or conversion or both will beaggregated into output blocks of the specified size.After the end of input is reached, any remaining output will be writtenas a block without paddingif<b>conv=sync</b>is not specified; thus the final output block maybe shorter than the output block size.<p></ol></blockquote><h4><a name = "tag_001_014_361">&nbsp;</a>OPTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_362">&nbsp;</a>OPERANDS</h4><blockquote>The following operands are supported:<dl compact><dt><b>if=</b><i>file</i><dd>Specify the input pathname; the default is standard input.<dt><b>of=</b><i>file</i><dd>Specify the output pathname; the default is standard output.If the<b>seek=</b>exprconversion is not also specified, the output filewill be truncated before the copy begins,unless<b>conv=notrunc</b>is specified.If<b>seek=</b>expris specified, but<b>conv=notrunc</b>is not,the effect of the copy will be to preserve the blocks in the outputfile over which<i>dd</i>seeks, but no other portion of the output file will be preserved.(If the size of the seek plus the sizeof the input file is less than the previous size of the outputfile, the output file will be shortened by the copy.)<dt><b>ibs=</b><i>expr</i><dd>Specify the input block size, in bytes, by<i>expr</i>(default is 512).<dt><b>obs=</b><i>expr</i><dd>Specify the output block size, in bytes, by<i>expr</i>(default is 512).<dt><b>bs=</b><i>expr</i><dd>Set both input and output block sizes to<i>expr</i>bytes, superseding<b>ibs=</b>and<b>obs=</b>.If no conversion other than<b>sync</b>,<b>noerror</b>and<b>notrunc</b>is specified, each input block will becopied to the output as a single block withoutaggregating short blocks.<dt><b>cbs=</b><i>expr</i><dd>Specify the conversion block size for<b>block</b>and<b>unblock</b>in bytes by<i>expr</i>(default is zero).If<b>cbs=</b>is omitted or given a value of zero, using<b>block</b>or<b>unblock</b>produces unspecified results.This operand must also be specified if the <b>conv=</b>operand is specifiedwith a value of <b>ascii</b>,<b>ebcdic</b>or <b>ibm</b>.For a <b>conv=</b>operand with an<b>ascii</b>value, the input is handled as described for the <b>unblock</b>value,except that characters are converted to ASCII before any trailing spacecharacters are deleted.  For <b>conv=</b>operands with <b>ebcdic</b>or <b>ibm</b>values, the input is handled as described for the <b>block</b>value except that the characters are converted to EBCDIC or IBM EBCDIC, respectively, after any trailing space characters are added.  <dt><b>skip=</b><i>n</i><dd>Skip<i>n</i>input blocks(using the specified input block size)before starting to copy.On seekable files, the implementation will read the blocks orseek past them; on non-seekable files, the blocks will be readand the data will be discarded.<dt><b>seek=</b><i>n</i><dd>Skip<i>n</i>blocks(using the specified output block size)from beginning of output file before copying.On non-seekable files, existing blocks will be read and spacefrom the current end-of-file to the specified offset, if any,filled with nullbytes; on seekable files, theimplementation will seek to the specified offset or read theblocks as described for non-seekable files.<dt><b>count=</b><i>n</i><dd>Copy only<i>n</i>input blocks.<dt><b>conv=</b><i>value</i><b>[,</b><i>value</i>&nbsp;...<b>]</b><dd>Where<i>value</i>sare comma-separated symbols from the following list.<dl compact><dt><b>ascii</b><dd>Convert EBCDIC to ASCII.See<xref href=ascebc><a href="#tagt_2">ASCII to EBCDIC Conversion</a></xref>.<dt><b>ebcdic</b><dd>Convert ASCII to EBCDIC.See<xref href=ascebc><a href="#tagt_2">ASCII to EBCDIC Conversion</a></xref>.<dt><b>ibm</b><dd>Convert ASCII to a different EBCDIC set.See<xref href=ascibm><a href="#tagt_3">ASCII to IBM EBCDIC Conversion</a></xref>.</dl><p>The<b>ascii</b>,<b>ebcdic</b>and<b>ibm</b>values are mutually exclusive.<dl compact><dt><b>block</b><dd>Treat the input as a sequence ofnewline-character-terminatedor end-of-file-terminatedvariable-length records independent of the input block boundaries.Each record is converted to a record with a fixedlength specified by the conversion block size.Anynewline characteris removed from the input line;space charactersare appended to linesthat are shorter than their conversion block size to fill the block.Lines that are longer than the conversion block size aretruncated to the largest number of characters that will fit intothat size; the number of truncated lines is reported (seethe STDERR section).The<b>block</b>and<b>unblock</b>values are mutually exclusive.<dt><b>unblock</b><dd>Convert fixed-length records to variable length.Read a number of bytes equal to the conversion block size(or the number of bytes remaining in the input, if lessthan the conversion block size),delete all trailingspace characters,and append a

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -