dd Flashcards
dd
![](https://s3.amazonaws.com/brainscape-prod/system/cm/313/336/530/q_image_thumb.png?1591385994)
Copy a file, converting and formatting according to the operands.
![](https://s3.amazonaws.com/brainscape-prod/system/cm/313/336/530/a_image_thumb.png?1591385987)
dd if=/dev/sda of=/dev/sdb bs=4096 conv=noerror, sync
This command is will copy the all data from /dev/sda to /dev/sdb.
if = input file
of = output file
bs=BYTES, setting this will set the limit of bytes to read and write at a time.
conv=CONVS, convert the file as per the comma separated symbol list.
noerror, Continue after read errors.
sync, pad every input block with NULs to ibs-size; when used with block or unblock, pad spaces rather than NULs.
dd if=/dev/sda of=/tmp/mbr.backup bs=512 count=1
This will make a backup of a MBR by listing the first disk and only copying the first 512 bytes. count=1 also limits the file to 1 input block.
count=N, Copy only N input blocks.
dd if=textfile.ebcdic of=textfile.ascii conv=ascii
This command will use the conv option to convert from ebcdic to ascii.
conv=ascii, From EBCDIC to ASCII
dd if=~/lcasefile of=~/uppercaseconv conv=ucase
or
dd if=~/upcasefile of=~/lowercaseconv conv=lcase
The two commands convert a file from lower case to upper case and upper case to lower case respectively. They do that through the conv option.
conv=ucase, Change lower case to upper case.
conv=lcase, Change upper case to lower case.