Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

kirky29

macrumors 68000
Original poster
Jun 17, 2009
1,673
1,026
Lincolnshire, England
So I have a folder, with about 100,000 images inside. I'd like to split them up into batches of either 1000 or 2000. How can I do this automatically? Without having to select 1000, right click > new folder etc?

Does anybody know of an app?

EDIT: Found one on the Mac App Store called Big Mean Folder Machine 2. It's £24.99, but worked flawlessly and did more than I originally wanted!
 
Last edited:

Basic75

macrumors 68020
May 17, 2011
2,101
2,448
Europe
Does anybody know of an app?

Of course, and it's even included with macOS!

Bash:
#!/bin/bash

count=1

while [ `ls source | wc -w` != "0" ]; do
    mkdir destination$count && mv $(echo source/* | tr ' ' '\n' | sort | head -n 1000 | tr '\n' ' ') destination$count
    count=$((count+1))
done

rm -f source/.DS_Store
rmdir source

In case you haven't guessed yet, it's Terminal.app.
 
  • Like
  • Love
Reactions: kirky29 and Brian33
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.