Sometimes, we need to quickly create a file of a specified size, for system testing, we specify that the following commands can be used in the Linux platform:
Create a 100M empty file
DD If=/dev/zero of=hello.txt bs=100m count=1
You can also quickly create a file of a specified size using the following commands on the Windows platform:
fsutil file createnew <filename> <length>
C:\>fsutil file CreateNew
Usage: fsutil file createnew <filename> <length>
For example: fsutil file createnew C:\testfile.txt 1024 Create a 1kb size files
C:\>fsutil
----Supported commands----
8dot3name 8dot3name Administration
behavior Control file system behavior
dirty the number of corrupted bits in the managed volume
file file-specific commands
fsinfo file System Information
hardlink hard link Management
objectid Object ID Management
quota Quota management
repair self-healing management
reparsepoint Analysis Point Management
resource Transaction Explorer Management
sparse sparse File Control
transaction transaction Management
usn USN Management
volume Volume management
C:\>fsutil file?
----the supported FILE commands----
Findbysid locating files by security identifier
Queryallocranges the allocation scope of the query file
Setshortname the short name of the settings file
Setvaliddata valid data length for the settings file
Setzerodata 0 Data for the setup file
CreateNew Create a new file of the specified size
Queryfileid querying the file ID of the specified file
Queryfilenamebyid a random link name showing the file ID
This article is from the "Eddy Technology blog" blog, please be sure to keep this source http://gongeddy.blog.51cto.com/2993788/1550361
Windows platform quickly creates a file of the specified size