These time I'll demonstrate more options of the shuf program. It can do quite a lot.
Shuffle a list of numbers
$ shuf -i 1-6
5
4
6
3
2
1
Generate random numbers from a range until aborted
$ shuf -r -i 1-6 # type C-c to abort
3
5
5
4
4
6
Random numbers with a limit
$ shuf -n 10 -r -i 1-6
6
3
2
4
1
3
1
6
5
2
Shuffle and print command arguments
$ shuf -e one two three four five six
five
four
one
two
six
three
Random command arguments with a limit
$ shuf -n 10 -r -e one two three four five six
six
six
five
five
six
three
one
four
three
five
Ask your questions about these examples below. Here's the full manual for shuf:
https://www.gnu.org/software/coreutils/manual/html_node/shuf-invocation.html
These time I'll demonstrate more options of the `shuf` program. It can do quite a lot.
#Shuffle a list of numbers
$ shuf -i 1-6
5
4
6
3
2
1
#Generate random numbers from a range until aborted
$ shuf -r -i 1-6 # type C-c to abort
3
5
5
4
4
6
#Random numbers with a limit
$ shuf -n 10 -r -i 1-6
6
3
2
4
1
3
1
6
5
2
#Shuffle and print command arguments
$ shuf -e one two three four five six
five
four
one
two
six
three
#Random command arguments with a limit
$ shuf -n 10 -r -e one two three four five six
six
six
five
five
six
three
one
four
three
five
Ask your questions about these examples below. Here's the full manual for `shuf`:
https://www.gnu.org/software/coreutils/manual/html_node/shuf-invocation.html
(post is archived)