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 - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -