The DD of Linux commands

Source: Internet
Author: User

DD [OPERAND]

DD option

Copy a file, convert and format it according to [OPERAND]

(1). Operand parameters

Note that the 1:DD option is only '--help ' and '--version ', that is, help and version information. The following are [operands], not options.

Illustration 2: Read is input, write is output

Bs=bytes a block size of BYTES bytes for both read and write (Input IBS output OBS)

Cbs=bytes convert BYTES bytes at a time, that is, specify the conversion buffer size

Conv=conversion[,conversion] Converting files with specified parameters

Count=n copies only N blocks, the block size equals the number of bytes specified by IBS

Ibs=bytes reads BYTES bytes at a time, specifying a block size of BYTES bytes (default 512)

If=file from file reading instead of standard input, i.e. specifying source file

Iflag=flag[,flag] Input method specified using the FLAG parameter

Obs=bytes writes BYTES bytes at a time, specifying a fast size of BYTES bytes (default 512)

Of=file writes to a file instead of standard output, which is the specified destination file

Oflag=flag[,flag] Use the FLAG parameter to specify the output mode

Seek=blocks Skip BLOCKS output blocks from the beginning of the output file and start copying (be careful that IBS is not the same as OBS)

Skip=blocks Skip BLOCKS input blocks from the beginning of the input file and start copying (be careful that IBS is not the same as OBS)

The Status=which is used to control the output information of the DD program. Noxfer,none and progress, respectively, default to progress. None outputs any relevant information and the error message is output normally. Noxfer does not output the final statistics. Progress output all information.

(2). Conversion parameters

ASCII converted from EBCDIC code to ASCII code

EBCDIC converted from ASCII to EBCDIC code

IBM converts ASCII code to a replacement EBCDIC code

Block outputs CBS bytes for each line in the input, replaces input line breaks with spaces, and fills with spaces if necessary

Unblock remove the trailing space of the CBS-sized block and add a newline character

LCase converting uppercase characters to lowercase characters

Nocreat do not create output file, output file must already exist

The excl output file already exists and fails; DD command must create the file itself

Notrunc do not truncate the output file (do not shorten the file length to 0)

UCase converting lowercase characters to uppercase characters

Sparse tries to find instead of writing an empty (NUL) output block. In a file system that supports sparse files, this creates a sparse output when the output file is extended.

Swab swap every pair of bytes, odd when the last byte is only copied

NoError continues after reading data error

Sync fills each input block with a blank (NUL) to the IBS size, and if used with a day block or unblock, fills with spaces instead of empty (NUL)

Write output file data to disk before Fdatasync ends

Fsync similar to the above, but the metadata is also written together

(3). Flag parameter

Append append mode. Copy the data to the end of the destination file, and you should set Conv=notrunc. Otherwise the file will be emptied before being copied.

The CIO uses the concurrent I/O access mode, which uses direct I/O. and remove the POSIX requirements to serialize all I/O to the same file. Unable to open the file in CIO mode, open a standard file (this may be wrong, original: A file cannot is opened at the CIO Mode,and with A standards open in the same time.)

Direct I/O access mode is used to avoid buffer cache (do not cache file data in memory)

Directory only copies folders, because many systems do not support I/O to folders, so it is not very useful.

The Dsync uses synchronous I/O mode to read and write data. Force a physical write (write/save to disk) every time you write

Sync data and metadata both use synchronous I/O mode.

Fullblock not return until a block has been filled

Nonblack using non-blocking I/O

Noatime does not change the access time of the file

Noctty does not use the specified file as the control terminal for DD

Nofollow does not follow symbolic links

Nolinks If there are multiple hard links fail (hard links and soft links are symbolic links, check it yourself, a bit complicated)

Binary I/O binary

Text using text i/0

Count_bytes sets the units of count to bytes, not blocks

(4). Units of measure that can be used for block size

Unit size

Code

Bytes (1B)

C

Bytes (2B)

W

Block (512B)

B

Kbytes (1024B)

K

MBytes (1024KB)

M

Gigabyte (1024MB)

G

The DD of Linux commands

Related Article

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.