Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

shuf

v(uutils coreutils) 0.1.0

Options

--echo, -e

shuf-help-echo

--input-range=<LO-HI>, -i <LO-HI>

shuf-help-input-range

--head-count=<COUNT>, -n <COUNT>

shuf-help-head-count

--output=<FILE>, -o <FILE>

shuf-help-output

--random-source=<FILE>

shuf-help-random-source

--repeat, -r

shuf-help-repeat

--zero-terminated, -z

shuf-help-zero-terminated

Examples

Randomize the order of lines in a file and output the result:

shuf {{path/to/file}}

Only output the first 5 entries of the result:

shuf {{[-n|--head-count]}} 5 {{path/to/file}}

Write the output to another file:

shuf {{path/to/input_file}} {{[-o|--output]}} {{path/to/output_file}}

Generate 3 random numbers in the range 1-10 (inclusive):

shuf {{[-n|--head-count]}} 3 {{[-i|--input-range]}} 1-10 {{[-r|--repeat]}}

The examples are provided by the tldr-pages project under the CC BY 4.0 License.

Please note that, as uutils is a work in progress, some examples might fail.