shuf

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
shuf
Repository
  • {{URL|example.com|optional display text}}Lua error in Module:EditAtWikidata at line 29: attempt to index field 'wikibase' (a nil value).
Engine
    Lua error in Module:EditAtWikidata at line 29: attempt to index field 'wikibase' (a nil value).
    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 | edit source]
    $ ls
    Wikibooks  Wikipedia  Wiktionary
    $ # Shuffles input 
    $ ls | shuf 
    Wikipedia
    Wiktionary
    Wikibooks
    $ # Picks one random line from input
    $ ls | shuf -n1
    Wikipedia
    

    See also

    [edit | edit source]

    References

    [edit | edit source]
    1. ^ shuf(1) – Linux General Commands Manual from ManKier.com