Jump to content

shuf

From Wikipedia, the free encyclopedia

This is the current revision of this page, as edited by Kvng (talk | contribs) at 16:34, 17 September 2023 (more specific link). The present address (URL) is a permanent link to this version.

(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
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[edit]

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

See also[edit]

References[edit]

  1. ^ shuf(1) – Linux General Commands Manual