Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 1
    Thanks for you answer. However, I did not read beyond the two first paragraphs of your answer, for two reason. First, you didn't understand my question correctly: I asked whether tar has an ability to compress the files while adding them to the archive. Second, you wrote incorrectly that tar doesn't support random access: see the --seek option.
    – Yuval
    Commented Nov 2, 2014 at 13:14
  • 1
    P.S. thanks for the lengthy explanation. zip is an excellent option for what I am looking for, and I might use it. Regarding extracting a single file for a gzip-compressed tar archive, the command would be: tar xfz archive.tgz path/in/archive/to/file
    – Yuval
    Commented Nov 2, 2014 at 13:20
  • @Yuval seek is an ability of the tar program to be used with archive formats that support random access, the tar archive format itself isn't designed for random access. ( en.wikipedia.org/wiki/Tar_%28computing%29#Random_access ) ( duplicity.nongnu.org/new_format.html#nottar ) It is possible to extract individual files from a tar, but this requires scanning the whole archive first to find them because there is no central catelogue. ( arstechnica.com/civis/viewtopic.php?f=16&t=409016 )
    – Robin Hood
    Commented Nov 2, 2014 at 20:57