功能:
读取文件的指定字节
语法:
dd if=file of=file1 bs=1 skip=1 count=1
参数说明:
if=文件名 | 输入的文件名 |
of=文件名 | 输出的文件名 |
ibs=bytes | 输入的块大小为bytes个字节 |
obs=bytes | 输出的块大小为bytes个字节 |
bs=bytes | 输入输出的块大小都为bytes个字节 |
count=blocks | 读取块的个数为blocks,一个块的大小为ibs的取值 |
skip=blocks | 从输入文件开头跳过blocks个块后再开始复制,块的大小为ibs的取值 |
seek=blocks | 从输出文件开头跳过blocks个块后再开始复制 |
示例:
读取文件file1.txt的第6到第10个字节输出到file2.txt中
dd if=/home/usr/file1.txt of=/home/tmp/file2.txt bs=1 count=5 skip=5
将文件file1.txt备份为文件file2
dd if=/home/usr/file1.txt of=/home/tmp/file2.txt