shellspells beta

shuf

shuf [OPTION]... [FILE]
     -e [OPTION]... [ARG]...
     -i LO-HI [OPTION]...

shuf writes a random permutation of the input lines to standard output.

Not something you would use a lot, but provides a nice elegant solution when you need a random list.

Examples

Create a random list of videos

# Get a list of videos
$ find $DIR -name '*.AVI' -print > $VIDLIST

# Shuffle them
$ shuf $VIDLIST > $RANDLIST