Randomize-lines

From Noah.org
Jump to navigationJump to search

The `rl` command will take input and output random lines. On Ubuntu you can install `rl` this way:

sudo apt-get install randomize-lines

This example selects a random restaurant from a list:

echo "Metate Taco
Double Play Pub
MotoJava cafe
Utah Saloon" | rl -c 1

This example plays a random video on the filesystems indexed by `locate`:

locate *.avi | rl -c 1 | xargs -n 1 -d \\n mplayer

This example searches for videos in the current working directory and randomly plays a video:

find . -name '*.avi' -print0 | rl -0 | xargs -n 1 -0 mplayer