shuf

Shuffle or pick random lines

low risk

interactive breakdown — edit the command and press Explain
$ 
What it does

Randomly permutes input lines or picks N of them.

Common flags
FlagMeaning
-nNumber of lines to output
-eTreat arguments as lines
-iPick random numbers from a range
Examples
shuf -n 5 words.txtFive random lines · explain & risk-check →
shuf -i 1-100 -n 1A random number · explain & risk-check →
Related
sort seq
Open the full explainer →More in Text Processing

Reference text is hand-written and may be incomplete — check man shuf for your version. Test destructive commands on a non-production system first.