为了创建 10 GB 临时文件...
在 Linux 中你可以这样做:
fallocate -l 10G temp_10GB_file
在 Windows 中,您可以执行以下操作:
fsutil file createnew temp_10GB_file 10000000000
...但是如果您使用的是 OS X 呢?
macOS 有命令mkfile
达到同样的目的:
mkfile -n 10g temp_10GB_file
Syntax:
mkfile [ -nv ] size[b|k|m|g] filename ...
这是相关的手册页 https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man8/mkfile.8.html for mkfile
跨平台替代方案(Unix,包括 macOS):
作为替代方案,您还可以使用 Unix utildd
:
dd if=/dev/zero of=temp_10GB_file bs=1 count=0 seek=10G
请注意,在 macOS 上,您需要使用小写字母来表示单位,如下所示:
dd if=/dev/zero of=temp_10GB_file bs=1 count=0 seek=10g
这是相关的手册页 https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/dd.1.html for dd
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)