$ shuf -n 1 file.txt
$ shuf -i 1-100 -n 5
$ shuf -e apple banana cherry
| -e | treat each argument as an input line (echo mode) |
| -n | output at most this many lines |
| -o | write the result to this file instead of stdout |
| -r | allow lines to repeat in the output |
| -i | shuffle the integers in this LO-HI range |
| -z | line delimiter is NUL, not newline |
| --head-count | output at most this many lines |
| --output | write the result to this file |
| --input-range | shuffle the integers in this LO-HI range |
| --repeat | allow lines to repeat in the output |
Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.