How to create a file with a given size in Linux?

后端 未结 13 1236
既然无缘
既然无缘 2020-11-28 17:57

For testing purposes I have to generate a file of a certain size (to test an upload limit).

What is a command to create a file of a certain size on Linux?

13条回答
  •  心在旅途
    2020-11-28 18:17

    On OSX (and Solaris, apparently), the mkfile command is available as well:

    mkfile 10g big_file
    

    This makes a 10 GB file named "big_file". Found this approach here.

提交回复
热议问题