SHUF(1)

πŸ“¦
version 9.10 Β· 5 versions
, in ubuntu stonking

πŸ¦‹ NAME

okay so shuf β€” it generates random permutations. That's it, that's the whole vibe: you give it lines, it gives them back to you in a scrambled order. ✨


🌸 SYNOPSIS

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

πŸ’– DESCRIPTION

Bestie. It writes a random permutation of the input lines to standard output. That's giving shuffle, that's giving chaos, that's giving main character energy for your data. πŸŽ€

If there's no FILE, or if FILE is -, it reads standard input instead. So you can absolutely pipe stuff into it, she loves that. 🫢

Mandatory arguments to long options are mandatory for short options too. (yes really, no cap β€” if it needs a value, it needs a value either way πŸ’…)

✨ the options, queen ✨

  • -e, --echo β€” treat each ARG as an input line. So the arguments themselves are the lines getting shuffled.
  • -i, --input-range=LO-HI β€” treat each number LO through HI as an input line. Build the lines for her, she'll scramble them.
  • -n, --head-count=COUNT β€” output at most COUNT lines. Like, she'll only hand you back that many.
  • -o, --output=FILE β€” write the result to FILE instead of standard output.
  • --random-source=FILE β€” get random bytes from FILE. That's where the randomness comes from, iykyk.
  • -r, --repeat β€” output lines can be repeated. Yes, duplicates are allowed, she's not judging.
  • -z, --zero-terminated β€” line delimiter is NUL, not newline. For those of you living that NUL-separated life. 🧚
  • --help β€” display this help and exit. Classic. Iconic.
  • --version β€” output version information and exit.

πŸ‘‘ AUTHOR

Written by Paul Eggert. We stan. πŸ’œ


😭 REPORTING BUGS

Found a bug? Tell the people, bestie:


🌈 SEE ALSO

  • Full documentation: https://www.gnu.org/software/coreutils/shuf
  • or available locally via: info '(coreutils) shuf invocation' β€” literally right there on your machine, go look πŸ‘€
  • Packaged by Ubuntu (9.10-1ubuntu2)
  • 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.
fr fr, there is genuinely no warranty. Read that part twice. πŸ’€

okay bye bestie, go shuffle something πŸ“ this was GNU coreutils 9.10, dated August 2026 β€” slay, periodt. πŸ’…β­

πŸ“¦ where this page comes from