shuf
Permute input lines randomly, with optional deterministic seeding for reproducibility. Use to randomize line order from files or stdin.
Instructions
Randomly permute input lines with optional deterministic seeding for reproducibility. Read-only, no side effects. Returns JSON with shuffled lines by default; use --raw for plain output. Set --seed for reproducible ordering. Use to randomize line order. Not for sorting — use 'sort' for ordered output. Not for deduplication — use 'uniq'. See also 'sort', 'uniq'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| raw | No | Write shuffled text without a JSON envelope. | |
| seed | No | Seed for deterministic shuffling. | |
| count | No | Maximum lines to output. | |
| paths | No | Files to shuffle, or '-' for stdin. Defaults to stdin. | |
| encoding | No | Text encoding (default: utf-8). Use 'auto' for BOM/autodetection. | utf-8 |
| max_lines | No | Maximum JSON lines to emit. | |
| show_encoding | No | Include encoding detection metadata in JSON result. | |
| encoding_errors | No | How to handle encoding errors (default: replace). | replace |
| encoding_profile | No | Locale-aware encoding fallback profile for auto-detection. |