#!/bin/bash extension="" echo "Type an extension to shuffle" read extension to_shuffle=$(find . -name "*.${extension}"); mkdir shuffled; for file in $to_shuffle; do rand=$RANDOM while test -f "shuffled/$rand.${extension}"; do rand=$RANDOM done mv ${file} shuffled/$rand.${extension} done echo "Done"