How to create a file of a certain size by linux
This article mainly introduces linux how to create a certain size file, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
Linux create file command: dd command
Copies the specified input file to the specified output file, and the format can be converted during the copy process. Syntax:
CODE: [Copy to clipboard] dd (option)
QUOTE:
If = enter the file (or device name).
Of = output file (or device name).
Ibs = bytes reads bytes bytes at a time, that is, the number of bytes read into the buffer.
Skip = blocks skips the ibs*blocks block at the beginning of the read-in buffer.
Obs = bytes writes bytes bytes at a time, that is, the number of bytes written to the buffer.
Bs = bytes also sets the number of bytes in the read / write buffer (equal to setting obs and obs).
Cbs = bytes converts bytes bytes at once.
Count = blocks copies only the input blocks blocks.
Conv = ASCII converts EBCDIC codes to ASCII codes.
Conv = ebcdic converts ASCII codes to EBCDIC codes.
Conv = ibm converts ASCII codes to alternate EBCDIC codes.
Conv = blick converts variable bits to fixed characters.
Conv = ublock converts the fixtures into motions.
Conv = ucase changes letters from lowercase to uppercase.
Conv = lcase changes letters from uppercase to lowercase.
Conv = notrunc does not truncate the output file.
Conv = swab swaps each pair of input bytes.
Conv = noerror does not stop processing when there is an error.
Conv = sync adjusts the size of each input record to the size of ibs (filled with ibs).
Fdformat command
Low-level formatted floppy disk.
Example:
Create an empty file of 100m
Dd if=/dev/zero of=hello.txt bs=100M count=1
Thank you for reading this article carefully. I hope the article "how to create a certain size document in linux" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!