'How do I use gshuf or python in the terminal to randomly shuffle files in a folder on mac os?

I am trying to randomly shuffle the files in a folder on my mac. I came across a suggestion to use gshuf (part of coreutils), but I don't know exactly what command to enter.

First I tried going into the folder and typing gshuf, and that didn't seem to do anything so I hit control-c to exit. Then I tried gshuf and the folder path, and I got an error:

gshuf /Users/xxx
gshuf: read error: Is a directory

Anyone know how to make it work? Can I use python in the terminal to do this?



Solution 1:[1]

I think you might want to try using -e for ECHO which treat each ARG as an input.

You can read the manual by:

$ man K- shuf

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Talha Junaid