Shuf
Encyclopedia
shuf is a command-line utility included in the textutils package of GNU Core Utilities
GNU Core Utilities
The GNU Core Utilities or coreutils is a package of GNU software containing many of the basic tools, such as cat, ls, and rm, needed for Unix-like operating systems...

 for creating a standard output consisting of random permutations of the input:


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

See also

  • sort -R
    Sort (Unix)
    sort is a standard Unix command line program that prints the lines of its input or concatenation of all files listed in its argument list in sorted order. Sorting is done based on one or more sort keys extracted from each line of input. By default, the entire input is taken as sort key...

    , sort --random-sort
    Sort (Unix)
    sort is a standard Unix command line program that prints the lines of its input or concatenation of all files listed in its argument list in sorted order. Sorting is done based on one or more sort keys extracted from each line of input. By default, the entire input is taken as sort key...

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK