SHUF(1) General Commands Manual SHUF(1)

shufprint contents shuffled

shuf [-z] [-n num] [file...]

shuf -e [-z] [-n num] [string...]

shuf reads each file in sequence and writes it on the standard output with some shuffling applied to each line. If no file is given or if file is "-", shuf reads from the standard input.

Use each string as an input line.
num
Output at most num lines.
Use NULL as line delimiter, not newline.

The shuf utility exits 0 on success, and >0 if an error occurs.

An shuf utility appeared in GNU coreutils 6.0.

Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>

2025-01-06 Linux 6.6.67-gentoo-x86_64