How can I use GNU's coreutils split command to split a large file into pieces of L number of lines each, but putting each of the different subfiles into different directories at the same time they are created?

Right now I have a perl script that creates a hierarchy of directories starting from ./00/00/00 to ./99/99/99 and doing perl prints of each line into subfiles in the script, but it's much slower than GNU's split command would do, creating all the subfiles in one directory. I would like to have them in the hierarchy of directories since it makes things more manageable for me later on.

1 Answer
1

The program does not support this (according to the info and man pages). You best bet is to move the files after they are created. Your next best bet is to add this feature and mail a patch to the current maintainer.

The first option is really not that hard to do and should not be very slow unless you are on a network mounted share. Consider using a fake reiserfs partition for this: