如何创建多个随机数据文件? [英] How Can I Create Multiple Files of Random Data?

查看:161
本文介绍了如何创建多个随机数据文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用 dd if = / dev / random of =< file_name> bs = XX count = XX 来创建随机数据的单个文件。但我想知道如何一次创建多个文件。说5,10或8万。我需要做一些带宽测试,需要独特的数据。上面的代码适用于1或2个文件。我的编程(Python)和终端技能仍然是非常小的。



任何帮助都将是非常棒的。

解决方案

男子分手。



拆分根据文件大小或行数将文件或标准输入分割为多个文件。但这并不是一次或同时发生的。

dd if = / dev / random bs = 1 count = 10 | split -b 2 产生5个文件xaa,xab..xae,每个文件由2个字节组成。


I've been using dd if=/dev/random of=<file_name> bs=XX count=XX to create single files of random data. But I wondered how I could create multiple files at once. Say 5, 10, or 80,000. I need to do some bandwidth testing and need unique data. The above code works great for 1 or 2 files. My programming (Python) and terminal skill are still very minimal.

Any help would be awesome.

解决方案

man split.

Split splits a file or stdin to multiple files based on file size or number of lines. It doesn't happen "at once" or in parallel though.

dd if=/dev/random bs=1 count=10 | split -b 2 produces 5 files xaa,xab..xae each consisting of 2 bytes.

这篇关于如何创建多个随机数据文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆