Shuffle or pick random lines
low risk
Randomly permutes input lines or picks N of them.
| Flag | Meaning |
|---|---|
-n | Number of lines to output |
-e | Treat arguments as lines |
-i | Pick random numbers from a range |
shuf -n 5 words.txtFive random lines · explain & risk-check →shuf -i 1-100 -n 1A random number · explain & risk-check →Reference text is hand-written and may be incomplete — check man shuf for your version. Test destructive commands on a non-production system first.