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.
- Why is it "GNU/Linux"
- Linux Manual: Fedora Linux
- Linux notes: Linux Command lines for three websites
- London securities launches the Linux operating system platform
- A variety of Linux from Linux individual developers