![]() |
Extract from `tar` archive as ordered in --files-from
Following command:
Code:
tar -xzf archive.tar.gz -T 'mylist.txt'How can I tell `tar` to extract files as ordered in 'mylist.txt' |
What do you mean by "order" ?
From tar man page: -T, --files-from F: get names to extract or create from file F basically, it extracts only files whose names are found in the specified file. |
I mean files in archive are compressed like:
... 3.txt 1.txt 2.txt and I have file list (mylist.txt): 1.txt 2.txt 3.txt ... And want to extract them in that order, not in order as they are compressed I (noob) was surprised that files aren't extracted in order as they are read from pointed filelist (mylist.txt) |
Why does the order matter, and how can you even tell what order they were extracted in?
|
If it doesn't matter I wouldn't have asked, but instead answering on more questions while I expected answer to what it seems to me clear question, I'll just thank you for your time.
Cheers |
A tar archive is a linear stream with no overall index. The only way to locate a file is to read the archive from the beginning. It was originally written to work with tape drives (the name comes from "Tape ARchiver"), where seeks are expensive, and is also frequently used in pipelines, where seeks are impossible. It will always list or extract files in the order they appear in the archive.
|
Thanks. Your reply cleared my question
|
| All times are GMT -5. The time now is 10:41 PM. |