move sequential files into folders
Posted on 2014-04-12
Is there a quick way to move a large number of files into sub-folders? I have a directory filled with a larger number of files (tens of thousands). I would like to move them into sub-directories, evenly, and in order. I could use a round robin sort of shuffle, but that would not keep them in order.
For example, if there were only 100 files total folder "1" would have files 1-10, folder "2" would have 11-20, etc. It is important that the folders have as close to even counts as possible. And, I don't always know how many files I will be dealing with.
Is this a fairly easy one liner type of fix, or is this a more detailed script type problem. I am hoping someone knows how to dole them out, assuming that the directories (1-10) are already created.