Function: Copies the specified input file to the specified output file, and can be converted to format during the copy process. You can use this command to realize the function of the diskcopy command under DOS. First use the DD command to write the data on the floppy disk as a storage file, and then put the storage file into the second floppy disk, complete the function of diskcopy. It should be noted that the storage files on the hard disk should be removed with the RM command. The system defaults to using standard input files and standard output files.
Syntax: DD [Options]
Copy Code code as follows:
if = input 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 skips the Ibs*blocks block at the beginning of the read buffer.
Obs = bytes Writes bytes bytes At a time, that is, the number of bytes written to the buffer.
BS = bytes Sets the number of bytes in the read/write buffer (equal to setting IBS and OBS).
CBS = byte convert bytes byte at a time.
Count=blocks only copies the input blocks blocks.
Conv = ASCII converts EBCDIC code to Ascil code.
Conv = EBCDIC converts ascil code to EBCDIC code.
CONV = IBM converts ascil code to alternate EBCDIC code.
CONV = block Converts a bit of change to a fixed character.
CONV = Ublock Converts a fixed bit into a change 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 Exchange Each pair of input bytes.
CONV = NoError does not stop processing when an error occurs.
Conv = sync the size of each input record to the size of the 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:
Copy Code code as follows:
$ 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:
Copy Code code as follows:
$ dd if =/tmp/tmpfile of =/dev/fd0
After the floppy copy is complete, you should delete the temporary file:
Copy Code code as follows:
Example 2: Write the net.i file to the floppy disk and set the number of read/write buffers.
(Note: The contents of the floppy disk will be completely overwritten)
Copy Code code as follows:
$ dd if = net.i of =/dev/fd0 bs = 16384
Example 3: Copy the file sfile to the file Dfile.
Copy Code code as follows: