4

When backing up large amounts of files, I've been taring them so that I only need to move one file around. But listing the content of tar files and extracting specific files out of them is really slow.

Is there a better alternative for this? Some way to tell tar to build an index and be seekable, or another archive format altogether?

0

Options -n, --seek assumes the archive is seekable, --no-seek assume the archive is not seekable, but it works only when reading (listing or extracting). Tar tries to determine this automatically.

So, try to use -n when listing/extracting, for example tar -ntf archive.tar.bz2.

|improve this answer|||||
  • Does this also apply when creating the archive? – user831885 Jan 6 '16 at 20:20
  • 2
    No, only when listing/extracting the archive. Tar is stream archiver. If you want to create a listing, you could use 'v' option, e.g. 'tar cvvjf /tmp/foo.tar.bz2 /path/to/files > /tmp/list.txt' and search through this file later. Look here, it could be useful (serverfault.com/questions/59795/…) – Konstantin Morenko Jan 7 '16 at 6:22

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.