我正在试验 Linux 的排序命令。我有文件 1:
one
two
three
four
five
我试过:
sort -R file
该命令的输出总是按预期随机排序
然后我尝试了:
sort --random-source=/dev/urandom file1
并且该命令始终具有以下输出:
five
four
one
three
two
为什么最后的排序命令输出总是一样的?不应该总是用这个命令随机排序吗?
我可以解释为什么会发生这种情况吗?
最佳答案
--random-source
选项在没有 -R
选项的情况下无效。
结果
five
four
one
three
two
按字母顺序正确排序。因此结果总是相同的。
关于linux - 随机排序不适用于 --random_source=FILE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50071093/