Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can I group files and create archives accordingly?

I have 10,000 files in a folder (no sub-folders) and I want to create 10 zip or tar.gz archives. This means every archive has 1,000 files.

How can I do this in Linux?

share|improve this question
add comment

1 Answer

Use find to get all the filenames, and redirect the output to a file outside of the directory. Use split to split that file into 10 pieces. At that point, check to see what option the archiving tool has to read a list of files either from a file or from standard input, and use it accordingly.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.