filestructure

Split a folder into multiple subfolders in terminal/bash script

痴心易碎 提交于 2020-06-24 07:26:29
问题 I have several folders, each with between 15,000 and 40,000 photos. I want each of these to be split into sub folders - each with 2,000 files in them. What is a quick way to do this that will create each folder I need on the go and move all the files? Currently I can only find how to move the first x items in a folder into a pre-existing directory. In order to use this on a folder with 20,000 items... I would need to create 10 folders manually, and run the command 10 times. ls -1 | sort -n |