Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

3 Answers

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
1  
7-zip supports compressed tarballs just fine. –  Dennis Jul 23 '12 at 12:46
add comment

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
add comment

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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