This cheat sheet provides a quick reference for some common
dd (data duplication) commands and concepts.
dd is a versatile command-line utility used for copying and converting files, as well as for creating disk images on Unix-like operating systems.
Input and Output
dd uses input and output options to specify the source and destination of data.
Input file (source):
Output file (destination):
Block Size and Count
You can specify the block size and count to control how data is read and written.
Block size (bytes):
Block count (number of blocks):
Skip and Seek
dd allows you to skip input data or seek to a specific position in the input data.
Skip N blocks from the input:
Seek N blocks from the beginning of the output:
dd can display progress information, including the number of records in and out.
- Show progress (send a signal to
You can use
conv to perform conversions on the data during copying.
Convert ASCII to EBCDIC:
Convert EBCDIC to ASCII:
dd is commonly used to create disk images.
- Create a disk image of a device:
dd if=/dev/source_device of=disk_image.img bs=4M
Copy data from one file to another:
dd if=input_file of=output_file bs=block_size count=block_count
Create a disk image from a device:
dd if=/dev/source_device of=disk_image.img bs=block_size
Show progress while copying:
dd if=input_file of=output_file bs=block_size count=block_count status=progress
Convert file format from ASCII to EBCDIC:
dd if=input_file of=output_file conv=ebcdic
Securely erase a disk with random data:
dd if=/dev/urandom of=/dev/target_device bs=4M status=progress
This cheat sheet covers some common
dd (Data Duplication) commands and concepts.
dd is a powerful command-line utility for copying, converting, and creating disk images; refer to the official
dd documentation for more in-depth information and advanced usage.