Linux DD Command

Source: Internet
Author: User


The DD command is a very powerful command, as described below:

DD is a very useful command under Linux/unix, which is to copy a file with a block of the specified size and make the specified conversion at the same time as the copy.

Main options for DD:
Specify the number of digits at the end of the following character multiplied by the corresponding number:
b=512, C=1, k=1024, w=2, Xm=number m

If=file
Enter a file name, which defaults to standard input.

Of=file
The output file name, which defaults to standard output.

Ibs=bytes
Reads a bytes byte at a time (that is, a block size of bytes bytes).

Obs=bytes
Write bytes bytes at a time (that is, a block size of bytes bytes).

Bs=bytes
The size of the read-write block at the same time is bytes, which can replace IBS and OBS.

Cbs=bytes
Converts bytes bytes at a time, that is, the size of the conversion buffer.

Skip=blocks
Skip blocks blocks from the beginning of the input file before copying begins.

Seek=blocks
Skip blocks blocks from the beginning of the output file before copying begins. (usually only valid if the output file is a disk or tape)

Count=blocks
Copies only blocks blocks, and the block size equals the number of bytes specified by IBS.

Conv=conversion[,conversion ...]
Converts the file with the specified parameters.

Conversion parameters:

The ASCII conversion EBCDIC is ASCII.

EBCDIC convert ASCII to EBCDIC.

IBM converts ASCII to alternate EBCDIC.

Block converts each row to a cbs-length record, and the insufficient portion is padded with spaces.

Unblock
Make each line the length of the CBS, the less part filled with spaces.

LCase converts uppercase characters to lowercase characters.

UCase converts lowercase characters to uppercase characters.

Swab swap each byte of the input. Unlike the
Unix DD, this works when an odd number of
Bytes is read. If the input file contains
An odd number of bytes, the last byte is
Simply copied (since there is nothing to
Swap it with).

NoError
Do not stop when an error occurs.

Notrunc
Does not truncate the output file.

Sync fills each input block into IBS bytes, and the less part is padded with empty (NUL) characters.

Because the DD command allows the binary to read and write, it is particularly suitable for input/output on the original physical device. For example, you can use the following command to create an image file for a floppy disk:
DD if=/dev/fd0 of=disk.img bs=1440k
Interestingly, this image file can be read out by Hd-copy, WinImage and other tool software. If you save the first 512 bytes of a hard disk as a file:
DD If=/dev/hda of=disk.mbr bs=512 count=1

Linux DD Command

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.