Linux uses the dd command to create a file of a specific size.

Source: Internet
Author: User

In Linux, the simplest way to create a specific size file using the dd command is to use the dd command. Dd if = "inputFileName" of = "outFileName" bs = "block size" count = "Block quantity" the block size can be measured in bytes (1B)-c (2B) -w block (512B)-B kilobytes (1024B)-k MB (1024 K)-M gib (1024 M)-G example: dd if =/dev/zero of = test. file bs = 1 M count = 10 create a 10 M file test in the current folder. the file content is 0/dev/zero, which is a character device and will continuously return 0 bytes (\ 0 ). if the input parameter (if) is not specified, the input is read from stdin by default. If no output parameter (of) is specified, stdout is output by default. You can also use the dd command to transmit a large amount of data to test the memory operation speed. $ Dd if =/dev/zero of =. /testmm. file bs = 10 M count = 10 records 10 + 0 read records 10 + 0 write 104857600 bytes (105 MB) Copied, 0.577581 seconds, 182 MB/second $ ll-h | grep 'testmm. file '-rw-r --. 1 itudu 100 M July 16 18:14 testmm. file type: general file:-directory file: d character device: c Block device: B link file: l socket file: s channel file: the read, write, and execute permissions for the p directory. Meaning: read permission: allows reading the list of files and subdirectories in the directory. Write Permission: allows you to create and delete files or subdirectories in the directory. Execute Permission: you can access files and subdirectories in the directory.

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.