The shuf command takes input from stdin, then passes them to stdout in random
order.
The call signature is:
shuf {options} {file}
When file is specified, lines from the specified file are read and passed to stdin.
The basic operation is simple. Given the following content:
ninja$: cat colors.csv 
red,#f00
green,#0f0
blue,#00f
yellow,#ff0
cyan,#0ff
magenta,#f0f
ninja$:  
The lines can be randomized using:
ninja$: shuf colors.csv 
green,#0f0
yellow,#ff0
magenta,#f0f
red,#f00
blue,#00f
cyan,#0ff
ninja$:  
Repeating this command generates a new random sequence:
ninja$: shuf colors.csv 
cyan,#0ff
yellow,#ff0
magenta,#f0f
red,#f00
blue,#00f
green,#0f0
ninja$:  
shuf includes the ability to generate a sequence of random integers within a specified
range using the -i option, followed by a range spec. For example, to generate a
sequence of random integers between 0 and 5 (inclusive):
ninja$: shuf -i 0-5 
1
0
3
4
2
5
ninja$:  
shuf can also generate random sequences from a set of arguments, using the -e
option. For example, to generate a random sequence of letters one could execute:
ninja$: shuf -e a b c d e 
c
b
d
e
a
ninja$: