Linux tar.gz 和 tgz 是一回事吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11534918/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 13:50:32  来源:igfitidea点击:

Are tar.gz and tgz the same thing?

linuxtar

提问by mko

I created .tgz file with tar czvf filecommand.then I ended up with a tgz file. I want to know the difference between it and tar.gz.

我用tar czvf file命令创建了 .tgz 文件。然后我得到了一个 tgz 文件。我想知道它和tar.gz的区别。

采纳答案by Tommy

I think in the old package repo days, .tgz was used because files on Dos floppies could only have three letter extensions. When this limitation was removed .tar.gz was used to be more verbose by showing both the archive type (tar) and zipper (gzip).

我认为在旧的包 repo 时代,使用 .tgz 是因为 Dos 软盘上的文件只能有三个字母扩展名。删除此限制后,.tar.gz 通过显示存档类型 (tar) 和拉链 (gzip) 变得更加冗长。

They are identical.

它们是相同的。

回答by duskwuff -inactive-

There's no difference at all. .tgzis simply shorthand for .tar.gz.

根本没有区别。.tgz只是 的简写.tar.gz

回答by adsc

One difference is that browsers seem to have trouble with .tar.gz sometimes, for example, when downloading such a file that already exists locally, it can happen, that they rename it to .tar-1.gz, which will then create problems with certain archivers, mostly on Windows and other environments that use filename ending for file type designation.

一个区别是浏览器有时似乎对 .tar.gz 有问题,例如,当下载这样一个本地已经存在的文件时,可能会发生这种情况,他们将其重命名为 .tar-1.gz,然后会产生问题使用某些归档程序,主要是在 Windows 和其他使用文件名结尾的文件类型指定的环境中。

This doesn't happen with .tgz ending.

.tgz 结尾不会发生这种情况。

回答by Albert

You can unzip tar.gz or .tgz with:

您可以使用以下命令解压缩 tar.gz 或 .tgz:

tar -xzvf

and create with:

并创建:

tar -czvf

It is absolutely the same

完全一样