dd Flashcards

1
Q

dd

A

Copy a file, converting and formatting according to the operands.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

dd if=/dev/sda of=/dev/sdb bs=4096 conv=noerror, sync

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

dd if=/dev/sda of=/tmp/mbr.backup bs=512 count=1

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

dd if=textfile.ebcdic of=textfile.ascii conv=ascii

A

This command will use the conv option to convert from ebcdic to ascii.

conv=ascii, From EBCDIC to ASCII

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

dd if=~/lcasefile of=~/uppercaseconv conv=ucase

or

dd if=~/upcasefile of=~/lowercaseconv conv=lcase

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly