From 51313692ca906443496e11a4c61584eb00158362 Mon Sep 17 00:00:00 2001 From: "rick.chan" Date: Tue, 22 Dec 2020 10:43:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=20DD=20=E5=8F=82=E6=95=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: rick.chan --- Software/Applications/DD/DD_命令的使用.md | 29 +++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Software/Applications/DD/DD_命令的使用.md b/Software/Applications/DD/DD_命令的使用.md index de7f0d7..c3329b3 100644 --- a/Software/Applications/DD/DD_命令的使用.md +++ b/Software/Applications/DD/DD_命令的使用.md @@ -1,3 +1,32 @@ # DD 命令的使用 +## 1.一般使用 + +```bash +# 不固定长度,读到文件结尾自动停止 dd if=\ of=/dev/\ bs=4M status=progress +# 指定长度(4Mx1024=4G) +dd if=\ of=/dev/\ bs=4M count=1024 status=progress +``` + +## 2.指定 Flag + +```bash +# iflag 指定 input flag +# iflag 指定 output flag +dd iflag=direct,nonblock if=\ oflag=direct,nonblock of=/dev/\ bs=4M status=progress +``` + +多个 Flag 之间可以用逗号分割,含义如下表。 + +| flags | Description | +|-----------|----------------------------------------------| +| direct | 读写数据采用直接 IO 方式 | +| directory | 读写失败除非是 directory | +| dsync | 读写数据采用同步 IO | +| sync | 同上,但是针对元数据 | +| fullblock | accumulate full blocks of input | +| nonblock | 读写数据采用非阻塞 IO 方式 | +| noatime | 读写数据不更新访问时间 | +| noctty | do not assign controlling terminal from file | +| nofollow | do not follow symlinks |