如何在 1s 内创建上百 G 的超大文件?


touch
vi(m)
tee
> 或 >>

$ dd if=/dev/zero of=big_file count=10 bs=1G
$ time dd if=/dev/zero of=big_file count=10 bs=1G
10+0 records in
10+0 records out
10737418240 bytes (11 GB) copied, 7.93627 s, 1.4 GB/s
real 0m7.941s
user 0m0.000s
sys 0m7.935s
$ ls -lh big_file
-rw-r--r-- 1 root root 10G Jun 2 10:57 big_file

$ fallocate -l 10G big_file
$ time fallocate -l 10G big_file
real 0m0.002s
user 0m0.000s
sys 0m0.001s
$ ls -lh big_file
-rw-r--r-- 1 root root 10G Jun 2 11:01 big_file
$ du -sh big_file
10G big_file

$ truncate -s 10G big_file
$ time truncate -s 10G big_file
real 0m0.001s
user 0m0.000s
sys 0m0.001s
$ ls -lh big_file
-rw-r--r-- 1 root root 10G Jun 2 11:11 big_file
$ du -sh big_file
0 big_file
更多精彩推荐
你点的每个“在看”,我都认真当成了喜欢
关注公众号:拾黑(shiheibook)了解更多
[广告]赞助链接:
四季很好,只要有你,文娱排行榜:https://www.yaopaiming.com/
让资讯触达的更精准有趣:https://www.0xu.cn/

随时掌握互联网精彩
赞助链接
排名
热点
搜索指数
- 1 站在创造未来的源头上 7904892
- 2 北京人要进化出鳃了 7809321
- 3 日本末日预言造成5600亿日元损失 7711899
- 4 高温天气这几件事不宜做 7617139
- 5 女主演拍戏身亡男主演昏迷?警方回应 7519648
- 6 瞒着家人考北大男生:让妈妈拆通知书 7423607
- 7 运输机坠毁致74人遇难 俄发表声明 7330251
- 8 “黄金平替”卖爆了 涨幅超过黄金 7231547
- 9 演员王梓薇买别墅了 7138018
- 10 一哥之争握手言和 南京0-0苏州 7041420