The Linux Newbie Guide  ⇒    Fundamentals     Advanced     Supplement   Command Index   ENG⇒中
All rights reserved, please indicate the source when citing
  

 

The dd command is a compact yet powerful conversion tool commonly used for both text and storage device transformations

Common parameters for text conversion include:
Examples:
$ dd if=file of=file_up conv=ucase ←Converts content from file "file" to uppercase and stores it in file "file_up"


Another important feature of dd is converting block devices and files. This operation typically requires superuser privileges and poses risks. If not used carefully, it can result in data loss on the hard disk. For this reason, dd is sometimes referred to as a "data destroyer." However, dangerous tools often have dual purposes; dd is also commonly used for disaster recovery. For converting block devices, common parameters include:



Examples:
# dd if=CentOS-6.5-x86_64-bin-DVD1.iso of=/dev/sdc ←Create a bootable disk from an ISO file.
# dd if=/dev/sda of=/dev/sdb ←Copy hard drive (/dev/sda --> /dev/sdb)
dd if=/dev/zero of=512M-image bs=512M count=1 ←Generate a 512M-sized file

For more information on dd operations and examples, please refer to the provided link.