Shuf

shuf
Operating systemUnix and Unix-like
PlatformCross-platform
TypeCommand
Licensecoreutils: GNU GPL v3

shuf is a command-line utility included in the textutils package of GNU Core Utilities for creating a standard output consisting of random permutations of the input.

The version of shuf bundled in GNU coreutils was written by Paul Eggert. It is not a part of POSIX.[1]

Example

$ ls
Wikibooks  Wikipedia  Wiktionary
$ # Shuffles input 
$ ls | shuf 
Wikipedia
Wiktionary
Wikibooks
$ # Picks one random line from input
$ ls | shuf -n1
Wikipedia

See also

  • sort -R
  • sort --random-sort

References

  1. ^ shuf(1) – Linux General Commands Manual
  • v
  • t
  • e
File system
Processes
User environment
Text processing
Shell builtins
  • alias
  • cd
  • echo
  • test
  • unset
  • wait
Searching
Documentation
Software development
Miscellaneous
  • bc
  • cal
  • expr
  • lp
  • od
  • sleep
  • true and false
  • Categories
    • Standard Unix programs
    • Unix SUS2008 utilities
  • List
  • v
  • t
  • e
File system
Text utilities
Shell utilities
Stub icon

This Unix-related article is a stub. You can help Wikipedia by expanding it.

  • v
  • t
  • e