Skip to content

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

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*