我必须衡量/ dev / urandom的效率.我有以下任务:检查1分钟内可以从/ dev / urandom获得多少字节的数据.不要将获取的数据写到磁盘上,因为这可能会减慢一切.

我试过了

timeout 60s cat /dev/urandom | wc -c

但是我收到的只是“已终止”消息.

解决方法:


添加–foreground选项:

timeout --foreground 60s cat /dev/urandom | wc -c
--foreground: when not running timeout directly from a shell prompt, allow COMMAND to read from the TTY and get TTY signals; in this mode, children of COMMAND will not be timed out

标签: bash, linux, random

相关文章推荐

添加新评论,含*的栏目为必填