parent
d6e0a6453d
commit
51313692ca
|
@ -1,3 +1,32 @@
|
|||
# DD 命令的使用
|
||||
|
||||
## 1.一般使用
|
||||
|
||||
```bash
|
||||
# 不固定长度,读到文件结尾自动停止
|
||||
dd if=\<in file name\> of=/dev/\<out file name\> bs=4M status=progress
|
||||
# 指定长度(4Mx1024=4G)
|
||||
dd if=\<in file name\> of=/dev/\<out file name\> bs=4M count=1024 status=progress
|
||||
```
|
||||
|
||||
## 2.指定 Flag
|
||||
|
||||
```bash
|
||||
# iflag 指定 input flag
|
||||
# iflag 指定 output flag
|
||||
dd iflag=direct,nonblock if=\<in file name\> oflag=direct,nonblock of=/dev/\<out file name\> 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 |
|
||||
|
|
Loading…
Reference in New Issue