如果这是file
:
hello world how are you today
Run Code Online (Sandbox Code Playgroud)
然后这world
将从file
:
dd bs=1 skip=6 count=5 if=file
Run Code Online (Sandbox Code Playgroud)
它跳过 6 个字节 ( hello_
),读取 5 个字节 ( world
),并忽略其余部分。
因此,使用skip
, count
, 和bs=1
(或者,当使用 GNU dd 时,使用 count_bytes/skip_bytes 标志),您可以以字节分辨率提取特定的字节范围。