R
R
Rinat Bakiev2016-12-28 10:52:14
bash
Rinat Bakiev, 2016-12-28 10:52:14

How to add the first 10,000 files to an archive?

Hello!
How can I add the first or any 10000 files to an archive in a given folder?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Max, 2016-12-28
@bakiev

the list of the first 10000 can be pulled out, for example, through the ls -l | awk '{print($9)}' | head -n 10000
last ones - similarly, through tail instead of head. Next, you submit the list to the input tar - profit.

S
Stepan Krapivin, 2016-12-28
@xevin

tar zcf 10000_files.tgz `ls -1 | head -n 10000`

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question