How can I move 100 random files from one directory to another in the Mac terminal? I would use shuf in linux.
Asked
Active
Viewed 421 times
0
-
1See https://stackoverflow.com/a/29959939/7552 – glenn jackman Jun 22 '18 at 15:36
1 Answers
1
Based on glenn's commend, here's the answer (this would move 100 random files in the current directory):
shuf -zen100 * | xargs -0 -J % mv % /New_Dir/

yalpsid eman
- 3,064
- 6
- 45
- 71