Choosing random files in Bash

Ben has a good post about choosing random files in Bash:


ls | while read x; do echo "`expr $RANDOM % 1000`:$x"; done \
     | sort -n| sed 's/[0-9]*://' | head -15

Leave a Reply

Your email address will not be published. Required fields are marked *