Created
February 7, 2020 17:47
-
-
Save jjwatt/d87fa559867d3d78067b4600f6c74078 to your computer and use it in GitHub Desktop.
Quick and dirty way to take a huge directory of roms/disk rips and split them into alphabetical directories. Not the most beautiful, but it gets the job done, you can still browse them and *much* faster dir loading/browsing on SDs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env bash | |
romdirsplit() { | |
for letter in {A..Z}; do | |
mkdir $letter | |
find ./ -iname "${letter}*" -type f -print0 \ | |
| xargs -0 -L1 mv -t "${letter}" | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oh yeah, might want to add
-maxdepth 0
for two main reasons:Actually, that might be because of xargs. Hmm. Anyway, it hasn't been an issue for me and the files seem fine. I'll look into it, though.