enter code hereThis is a one liner to randomize STDIN, the aim is to feed a list of files and tail -N gives you N random out of a huge list (bigger than N anyway):
ruby -e 'arr=[]; ARGF.each {|line| arr << line}; puts arr.sort_by {rand}'
I am wondering if there is a shorter version.
The winner is:
find . -type f | ruby -e 'puts ARGF.sort_by {rand}'