Quickly create large file on a Windows system

前端 未结 23 2308
别那么骄傲
别那么骄傲 2020-12-07 06:35

In the same vein as Quickly create a large file on a Linux system, I\'d like to quickly create a large file on a Windows system. By large I\'m thinking 5 GB.

23条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-07 07:17

    I was searching for a way to generate large files with data, not just sparse file. Came across the below technique:

    If you want to create a file with real data then you can use the below command line script.

    echo "This is just a sample line appended to create a big file.. " > dummy.txt
    for /L %i in (1,1,14) do type dummy.txt >> dummy.txt
    

    (Run the above two commands one after another or you can add them to a batch file.)

    The above commands create a 1 MB file dummy.txt within few seconds...

提交回复
热议问题