出于测试目的,我必须生成一个特定大小的文件(以测试上传限制)。
在 Linux 上创建一定大小文件的命令是什么?
最佳答案
对于小文件:
dd if=/dev/zero of=upload_test bs=file_size count=1
其中 file_size
是测试文件的大小(以字节为单位)。
对于大文件:
dd if=/dev/zero of=upload_test bs=1M count=size_in_megabytes
https://stackoverflow.com/questions/139261/
相关文章:
python - Conda 是否取代了对 virtualenv 的需求?
python - 如何将列表中的所有项目与 Python 相乘?
python - 在 Python 中计算 Pearson 相关性和显着性
python - 在 django Forms 中定义 css 类
python - 在 chrome 中运行 Selenium WebDriver python 绑定
linux - 如何确定进程是否在 lxc/Docker 内部运行?
python - 如何在 Python 中获取当前执行文件的路径?
linux - Linux Ubuntu下启动时自动运行程序