如何在Linux中创建一个给定大小的文件? [英] How to create a file with a given size in Linux?
本文介绍了如何在Linux中创建一个给定大小的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
为了测试目的,我必须生成一定大小的文件(测试上传限制)。
For testing purposes I have to generate a file of a certain size (to test an upload limit).
在Linux上创建一定大小的文件的命令是什么?
What is a command to create a file of a certain size on Linux?
推荐答案
dd if=/dev/zero of=upload_test bs=file_size count=1
其中 file_size
是测试文件的大小(以字节计)
Where file_size
is the size of your test file in bytes
这篇关于如何在Linux中创建一个给定大小的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文