Skip to content

Instantly share code, notes, and snippets.

@gx86
Created March 31, 2014 02:52
Show Gist options
  • Save gx86/9884350 to your computer and use it in GitHub Desktop.
Save gx86/9884350 to your computer and use it in GitHub Desktop.
Random files bash
#one file, spaces handled correctly
files=(./*) printf "%s\n" "${files[RANDOM % ${#files[@]}]}"
#random list, spaces.. maybe
"$(ls | sort -R)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment