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

后端 未结 13 1241
既然无缘
既然无缘 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:28

    dd if=/dev/zero of=upload_test bs=file_size count=1
    

    Where file_size is the size of your test file in bytes

提交回复
热议问题