Get the App
SLTechnology News&Howtos  ›  Servers  › 

Use the shuf command of linux to generate random permutations

Shulou Source: shulou.com Published: 2022-06-02 12:45:07 10月03日 Update

This article will explain in detail the random arrangement of shuf commands using linux. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

The shuf command randomly arranges the input and outputs it. The shuf command reads standard input when there is no file or when the file is -.

Syntax format: shuf [parameters]

Common parameters:

Reference example

Simulate the coin toss and get the top 10 results:

[root@linuxcool] # shuf-r-n 10-e "front"-e "negative" front and back

Simulated sports lottery super lottery:

[root@linuxcool] # shuf-I 1-35-n 5 | sort-n & & shuf-I 1-12-n 2 | sort-n417202931611 so much for the random permutation generated by using the linux shuf command. I hope the above content can be helpful to you and learn more. If you think the article is good, you can share it for more people to see.

Tags: Heads tails commands contents parameters files more articles references inputs good practical sports lottery big music examples commonly used articles standards formats knowledge Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Huawei Docker NVidia Shulou Technology