shuf
ShellFundamentals In simulator In real LinuxShuffle lines randomly
Name: shuf = shuffle
You can practise it right away in the simulator, and use it in real Linux mode too.
Description
shuf randomly permutes its input lines; -n keeps N of them and -i draws from a number range. Use it for sampling, picking at random or test data.
Syntax
shuf [OPTION]... [FILE]Common options
| -n / --head-count COUNT | Output at most N lines |
| -i / --input-range LO-HI | Shuffle a number range, e.g. -i 1-100 |
| -e / --echo | Shuffle the arguments given on the command line |
| -r / --repeat | Allow repeats (with -n: draw as many as you like) |
| -o / --output FILE | Write the result to FILE |