Novice trick: dd command skill under Linux operating system

  

Command name: dd

Use permission: All users dd This command is defined in manual as convert and copy a file

How to use:

dd [option]

If you want to watch manual, you can try

dd --help

or

info dd

If you want to see how this version:

dd --version

Input or Output

dd If=[STDIN] of=[STDOUT]

How many Bytes are forced to input or output

bs: dd -ibs=[BYTE] -obs=[SIZE]

Forcing only how many Bytes to do at a time

cbs=BYTES

Output after skipping a period

seek=BLOCKS

After skipping for a while Input

skip=BLOCKS

Of course you can take this to easily copy the disc (note that your disc is the standard iso9660 format can do this!)

Dd if=/dev/cdrom of=cdrom.iso

The content after the if and after is adjusted according to your needs.

Then give the system this command can be burned:

cdrecord -v cdrom.iso

This is not talking about cdrecord, so the above instructions are the simplest but Not necessarily in line with your hardware environment...

Function: Copy the specified input file to the specified output file, and format conversion during copying. You can use this command to implement the diskcopy command under DOS. First use the dd command to write the data on the floppy disk as a registered file on the hard disk, and then write the registered file to the second floppy disk to complete the diskcopy function. It should be noted that the registered file on the hard disk should be deleted with the rm command. The system uses standard input files and standard output files by default.

Syntax: dd [options]

if=Enter the file (or device name).

of=Output file (or device name).

ibs = bytes Read bytes bytes at a time, that is, the number of bytes read into the buffer.

skip = blocks Skip the ibs*blocks block at the beginning of the buffer.

obs = bytes Write bytes bytes at a time, that is, the number of bytes written to the buffer.

bs = bytes Set the number of bytes in the read/write buffer (equal to setting ibs and obs).

cbs = byte Convert bytes bytes at a time.

count=blocks Only copy the input blocks.

conv = ASCII Converts EBCDIC codes to ASCIl codes.

conv = ebcdic Converts an ASCIl code to an EBCDIC code.

conv = ibm Converts an ASCIl code to an alternate EBCDIC code.

conv = block Converts a change bit to a fixed character.

conv = ublock Converts a fixed bit to a variable bit.

conv = ucase Converts letters from lowercase to uppercase.

conv = lcase Converts letters from uppercase to lowercase.

conv = notrunc Does not truncate the output file.

conv = swab exchanges each pair of input bytes.

conv = noerror Does not stop processing when an error occurs.

conv = sync Adjust the size of each input record to the size of ibs (filled with NUL).

Example 1: To copy the contents of a floppy disk to another floppy disk, use /tmp as a temporary storage area. Insert the source disk into the drive and enter the following command:

$ dd if =/dev/fd0 of = /tmp/tmpfile

After the copy is complete, remove the source disk from the drive. Insert the target disk and enter the command:

$ dd if = /tmp/tmpfile of =/dev/fd0

After the floppy copy is complete, the temporary file should be deleted:

$ rm /tmp/tmpfile

Example 2: Write the net.i file to a floppy disk and set the number of read/write buffers.

(Note: The contents of the floppy disk will be completely overwritten)

$ dd if = net.i of = /dev/fd0 bs = 16384

Example 3: Copy the file sfile to the file dfile.

$ dd if=sfile of=dfile

Copyright © Windows knowledge All Rights Reserved