Consider a directory with N files.
I can list the files alphabetically sorted and store the list by
ls > list
Then I want to create n sub-directories in same directory, which can be done by
mkdir direc{1..n}
Now I want to move the first m or say first 5 (1-5) files from list
to direc1
, the next 5 file i.e. 6-10 to direc2
and so on.
This may be a trivial task for you guys, but am not able to do it at the moment. Please help.