2014-09-08 13:27:44 +04:00
|
|
|
# shuf
|
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
> Generate random permutations.
|
2014-09-08 13:27:44 +04:00
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
- Randomize the order of lines in a file and output the result:
|
2014-09-08 13:27:44 +04:00
|
|
|
|
|
|
|
`shuf {{filename}}`
|
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
- Only output the first n entries of the result:
|
2014-09-08 13:27:44 +04:00
|
|
|
|
|
|
|
`shuf -n {{n}} {{filename}}`
|
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
- Write output to another file:
|
2014-09-08 13:27:44 +04:00
|
|
|
|
|
|
|
`shuf -o {{another_filename}} {{filename}}`
|
2014-09-10 17:58:31 +04:00
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
- Generate random numbers in range:
|
2014-09-10 17:58:31 +04:00
|
|
|
|
|
|
|
`shuf -i {{low}}-{{high}}`
|