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

IF statement in MySQL trigger -

c++ - What does MSC in "// appease MSC" comments mean? -

android - MPAndroidChart - How to add Annotations or images to the chart -