linux - BASH : On OSX, how to list a folder randomly? -


this question has answer here:

i want generate list of files located in folder, randomly. tried list folder using l -s in order sort files size, it's not totally random. have best idea ?

my script :

for file in `ls $folder`   ...  done 

  1. build list of files using ls, 1 entry per line
  2. use sort --random-sort shuffle results

Comments

Popular posts from this blog

android - How to save instance state of selected radiobutton on menu -

python 3 IndexError: list index out of range -

IF statement in MySQL trigger -