dd 中的‘bs’选项是什么?

dd 中的‘bs’选项是什么?

我在网上找到了一些相互矛盾的信息,比如bs命令中的dd bs=512 if=/home/Downloads/ubuntu.iso of=/dev/sdb代表的是“每秒字节数”还是“块大小”。我在手册页中找不到任何内容,因为唯一的参考是bs

bs=字节

每次读取和写入最多 BYTES 字节

答案1

与其他 GNU Coreutils 实用程序一样,主要文档是info页面。

info coreutils dd invocation

‘bs=BYTES’
     Set both input and output block sizes to BYTES.  This makes ‘dd’
     read and write BYTES per block, overriding any ‘ibs’ and ‘obs’
     settings.  In addition, if no data-transforming ‘conv’ option is
     specified, input is copied to the output as soon as it’s read, even
     if it is smaller than the block size.

各个读取、写入和转换块大小都有相应的参数:

‘ibs=BYTES’
     Set the input block size to BYTES.  This makes ‘dd’ read BYTES per
     block.  The default is 512 bytes.

‘obs=BYTES’
     Set the output block size to BYTES.  This makes ‘dd’ write BYTES
     per block.  The default is 512 bytes.

‘cbs=BYTES’
     Set the conversion block size to BYTES.  When converting
     variable-length records to fixed-length ones (‘conv=block’) or the
     reverse (‘conv=unblock’), use BYTES as the fixed record length.

相关内容