Linux Command dd

Source: Internet
Author: User

Linux is becoming more and more popular among computer users. If you are an old Linux User, here we will introduce you to the knowledge of Linux/UNIX Command dd:

Dd is a very useful command in Linux/UNIX. It is used to copy an object with a specified size block and perform the specified conversion at the same time.
Main options of dd:
If the following column ends with a specified number, multiply it by the corresponding number:
B = 512, c = 1, k = 1024, w = 2, xm = number m
If = file
Input File name. The default value is standard input.
Of = file
Output file name. The default value is standard output.
Ibs = bytes
Read bytes at a time (that is, the size of a block is bytes ).
Obs = bytes
Write bytes at a time (that is, the size of a block is bytes ).
Bs = bytes
Set the size of the read/write block to bytes, which can replace ibs and obs.
Cbs = bytes
Bytes are converted at a time, that is, the size of the conversion buffer.
Skip = blocks
The blocks are skipped from the beginning of the input file and then copied.
Seek = blocks
The blocks are skipped from the beginning of the output file and then copied. (Usually only valid when the output file is a disk or tape)
Count = blocks
Copy only blocks. The block size is equal to the number of bytes specified by ibs.
Conv = conversion [, conversion...]
Use the specified parameter to convert the file.
Conversion parameters:
Ascii conversion EBCDIC is ASCII.
Ebcdic converts ASCII to EBCDIC.
IBM converts ASCII to alternate EBCDIC.
Block converts each row to a record with a length of cbs. The missing part is filled with spaces.
Unblock
Make the length of each line be cbs, and fill the remaining part with spaces.
Lcase converts uppercase to lowercase.
Ucase converts lowercase to uppercase.
Swab exchanges each pair of input bytes. Unlike
Unix dd, this works when an odd number
Bytes are read. If the input file contains
An odd number of bytes, the last byte is
Simply copied (since there is nothing
Swap it ).
Noerror
Do not stop when an error occurs.
Notrunc
The output file is not truncated.
Sync fills each input block into ibs bytes, and the missing part is filled with null (NUL) characters.
Since the dd command allows binary read/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 = 1440 k
Interestingly, this image file can be read by tools such as HD-Copy and Winimage. Another example is to save the first 512 bytes of the first hard disk as a file:
Dd if =/dev/hda of = disk. mbr bs = 512 count = 1

This article introduces how to understand the Linux/UNIX Command dd in the Linux operating system.

  1. Why is it "GNU/Linux"
  2. Linux Manual: Fedora Linux
  3. Linux notes: Linux Command lines for three websites
  4. London securities launches the Linux operating system platform
  5. A variety of Linux from Linux individual developers

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.