Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .