Linux common commands-68: dd

dd command is used to read, convert and output data. Data can be read from standard input or a file, converted to a specified format, and output to a file, device, or standard output.

Syntax format: dd [parameter]

Common parameters:

Example

 # /dev/null,可以向它输出任何数据# /dev/zero,是一个输入设备,可以用它来初始化文件,该设备无穷尽地提供0 # 备份/dev/sdb全盘数据,使用gzip压缩并保存dd if=/dev/sdb | gzip > /root/image.gz # 将压缩的备份文件恢复到指定盘gzip -dc /root/image.gz | dd of=/dev/sdb # 测试硬盘的写速度dd if=/dev/zero bs=1024 count=1000000 of=/root/1Gb.file # 测试硬盘的读速度dd if=/root/1Gb.file of=/dev/null bs=64k

This article is reprinted from https://xugaoxiang.com/2022/06/22/linux-cmds-68-dd/
This site is for inclusion only, and the copyright belongs to the original author.

Leave a Comment