SHUF(1) User Commands SHUF(1)

# [NAME](#NAME)

shuf - generate random permutations

# [SYNOPSIS](#SYNOPSIS)

**shuf** \[*OPTION*]... \[*FILE*]  
**shuf** *-e* \[*OPTION*]... \[*ARG*]...  
**shuf** *-i LO-HI* \[*OPTION*]...

# [DESCRIPTION](#DESCRIPTION)

Write a random permutation of the input lines to standard output.

With no FILE, or when FILE is -, read standard input.

Mandatory arguments to long options are mandatory for short options too.

[**-e, --echo**](#e,)

treat each ARG as an input line

[**-i, --input-range=LO-HI**](#i,)

treat each number LO through HI as an input line

[**-n, --head-count=COUNT**](#n,)

output at most COUNT lines

[**-o, --output=FILE**](#o,)

write result to FILE instead of standard output

[**--random-source=FILE**](#random)

get random bytes from FILE

[**-r, --repeat**](#r,)

output lines can be repeated

[**-z, --zero-terminated**](#z,)

line delimiter is NUL, not newline

[**--help**](#help)

display this help and exit

[**--version**](#version)

output version information and exit

# [AUTHOR](#AUTHOR)

Written by Paul Eggert.

# [REPORTING BUGS](#REPORTING_BUGS)

Report bugs to: &lt;bug-coreutils@gnu.org&gt;.  
Report any translation bugs to: &lt;https://translationproject.org/team/&gt;.  
GNU coreutils home page: &lt;https://www.gnu.org/software/coreutils/&gt;  
General help using GNU software: &lt;https://www.gnu.org/gethelp/&gt;

# [COPYRIGHT](#COPYRIGHT)

Copyright © 2026 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later &lt;https://gnu.org/licenses/gpl.html&gt;.  
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

# [SEE ALSO](#SEE_ALSO)

Full documentation &lt;https://www.gnu.org/software/coreutils/shuf&gt;  
or available locally via: info '(coreutils) shuf invocation'

October 2026 GNU coreutils 9.12

---

Document: shuf(1) from coreutils 9.12-r7 (Chainguard OS)
Source: https://git.savannah.gnu.org/git/coreutils.git
