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 used command tar -cvzf upload.tar upload to compress my upload folder, but when i'll extract it on widows using 7-Zip it shows up as just a single file, not folder.

And the uplad folder isn't symlink - it is real directory. File size is correct, but it is not a folder on windows

Okay - found the problem. Caused by the -z flag. So running tar -cvf upload.tar upload works. Why is that so? Docs say that z flag - 'Compress or decompress files automatically.'

Why is that so?

share|improve this question
up vote 3 down vote accepted

You probably misled the Windows utility by using extension tar on a gzipped file. As you're using gzip compression by using the -z flag, the common file-types are .tgz and .tar.gz. I have no idea whether or not 7-zip supports this. Alternatively you can drop the z flag.

share|improve this answer
7-zip supports compressed tarballs just fine. – Dennis Jul 23 '12 at 12:46

That is due to historical reasons.

Back in the days of yore when compression was still very expensive there was this program to backup data to tapes. It was called Tape ARchive. A tape device on unix is just a file, so it was also possible to dump this archive to a file. That file normally gets the extension .tar.

It you wanted to compress this a file (E.g. a freshly made backup) you used the program compress which added the extension .Z The resulting file then got both extentions. (file.tar.Z)

Later versions allowed you to combine these with the -z flag in tar. They also after substituted gzip for compress. The resulting gzip compressed tar file usually have the extension .tar.gz, or on some windows computers (due to 8.3 limitations) .tgz.

share|improve this answer

Scroll to the right in 7-zip and you'll probably see it shows a full folder path.

If you drag it to your desktop, does it write the folder (and any subfolders/files)?

share|improve this answer

You must log in to answer this question.

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