2

I previously asked how to create an index of a multi-volume archive. That question contained the assumption that using tar --list after writing my volumes would have to re-read all my data and hence be slow

However, is that true? Will it have to re-read every byte, or is GNU tar intelligent enough to seek over archive members and hence list the archive contents very quickly?

I did a bit of testing with a 35GB tar file and the result (completion within 2 seconds) seems to indicate that --list is indeed fast, though I don't completely trust my testing methodology and couldn't rule out the influence of caching or something else I don't understand.

5

If the archive is seekable, tar will take advantage of that to skip through the archive. So if your archive is an uncompressed file, tar --list will skip from one header to the next and process the file very quickly.

See also the -n option. (And look for "seek" in the tar manpage.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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