Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know that when I compress an archive with the 7za utility, it gives me stats like the number of files processed and the amount of bytes processed (the original size of the data).

Is it possible, using the commandline (on linux) or some programming language, to determine:

  • the original size of an archive, before it was compressed?
  • the number of files/directories contained within an archive?

The answer might be "no, just decompress the whole archive and do counting/sizing then", but it would be useful to know if there was a faster/less space-greedy way.

share|improve this question
up vote 3 down vote accepted

You could pipe the output from 7za l <path to archive> into a text file or directly into a program written in the programming language of your choice.

share|improve this answer

Well I dont know if it works with 7za. But you can estimate a Tar size before you created the Tar file with this command.

$ tar -cf - /directory/to/archive/ | wc -c


share|improve this answer
Thanks, but I was hoping for a method that doesn't require me to perform operations when the archive is being created. I want to be able to determine the filecount/estimated size if I just have an archive, and no knowledge of how/when/where it was made. – Zac B Jul 5 '12 at 13:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .