shuf
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.
Operating system | Unix and Unix-like |
---|---|
Type | Command |
License | coreutils: GNU GPL v3 |
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
gollark: AP just gave me a free purple nebula!
gollark: But is it very reflective, almost metallic looking?
gollark: Another several days, another gold missed.
gollark: If NDs can be hatched in minutes then prizekins can be hatched in an hour or whatever.
gollark: Wait, release tonight?
See also
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.