SHUF(1)

โœจ NAME โœจ

shuf โ€” bestie, this generates random permutations ๐Ÿ’…


๐ŸŒธ SYNOPSIS ๐ŸŒธ

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

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

Okay so here's the tea: shuf writes a random permutation of the input lines to standard output. That's it. That's the whole vibe. It shuffles your lines and gives them back to you in a different order. Iconic behavior, no notes. ๐ŸŽ€

If there's no FILE, or if FILE is -, it reads from standard input. So you can pipe stuff in like it's nothing.

Mandatory arguments to long options are mandatory for short options too. (iykyk โ€” this is the standard GNU rule, fr fr.)

  • -e, --echo โ€” treat each ARG as an input line ๐Ÿซถ
  • -i, --input-range=LO-HI โ€” treat each number LO through HI as an input line ๐Ÿ”ข
  • -n, --head-count=COUNT โ€” output at most COUNT lines, like a little snack portion โœจ
  • -o, --output=FILE โ€” write the result to FILE instead of standard output ๐Ÿ“
  • --random-source=FILE โ€” get random bytes from FILE ๐ŸŽฒ
  • -r, --repeat โ€” output lines can be repeated, so yes you might see the same line twice, that's on purpose ๐Ÿ’€
  • -z, --zero-terminated โ€” line delimiter is NUL, not newline โญ
  • --help โ€” display this help and exit ๐Ÿ‘‘
  • --version โ€” output version information and exit ๐ŸŒˆ

๐Ÿ’– AUTHOR ๐Ÿ’–

Written by Paul Eggert. We stan. ๐Ÿซถ


๐Ÿ™ˆ REPORTING BUGS ๐Ÿ™ˆ

Found something cursed? Tell the devs, bestie:


Copyright ยฉ 2026 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law. ๐Ÿ˜ญ Not even a little one. None. Zero. Nada.

๐Ÿงš SEE ALSO ๐Ÿงš


Okay that's the whole page, bestie โ€” go forth and shuffle. This was GNU coreutils 9.12, dated September 2026. Mwah. ๐Ÿ’…โœจ

๐Ÿ“ฆ where this page comes from