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.

shuf
Operating systemUnix and Unix-like
TypeCommand
Licensecoreutils: 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: Which is going to be replaced with something else eventually™, once I design that
gollark: I don't do much useful art, this was just a favicon for my website.
gollark: For vector graphics I've ended up manually writing SVGs in the past.
gollark: Unless it just makes them do more in-house research which *nobody* can see.
gollark: Making nation-states have to pay more to hack people is... probably good, since they might do it less.

See also

References

  1. shuf(1)  Linux General Commands Manual
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.