.tar.gz文件_什么是tar.gz文件,如何打开它?

.tar.gz文件

.tar.gz文件

A tar file, often called a tarball, is a collection of files wrapped up in one single file for easy storage. Rather than keep track of a whole folder of files, you only need to keep track of one. Tar files are often compressed after being created, giving it the .tar.gz file extension. Technically these are TGZ files, but nearly everyone calls both .tar and .tar.gz files simple “tar files.”

tar文件(通常称为tarball )是将文件打包在一起的一个集合,以便于存储。 您无需跟踪整个文件文件夹,而只需跟踪一个文件。 创建后,通常会压缩Tar文件,并为其提供.tar.gz 文件扩展名 。 从技术上讲,它们是TGZ文件,但几乎每个人都将.tar和.tar.gz文件称为简单的“ tar文件”。

如何打开Tar文件? (How Do I Open a Tar File?)

If you’re on macOS or Linux and don’t mind using a terminal, it’s just a single command (where tarfile is the name of your file):

如果您使用的是macOS或Linux,并且不介意使用终端,则只需一个命令即可(其中tarfile是文件名):

tar -xzf tarfile

There are also a few flags you can add to the command to have it perform slightly different functions:

您还可以在命令中添加一些标志,以使其执行略有不同的功能:

  • -v: Enables verbose mode, showing the progress of the command

    -v:启用详细模式,显示命令的进度

  • -x: Extract

    -x :提取

  • -z: Uses gzip, omit this if you just have a .tar

    -z:使用gzip,如果只有.tar,则忽略此

  • -f: specifies file input, rather than STDIN

    -f :指定文件输入,而不是STDIN

Those last three flags can be a little hard to remember on the spot, so a good mnemonic to use is “Xtract Ze File.” You can also pretend you’re the Terminator when you run it.

最后三个标志在现场可能很难记住,因此使用的一个好记号是“ Xtract Ze File”。 您也可以在运行它时假装自己是终结者。

Creating a tar file is just as easy. Just replace the -x with a -c to “Create,” though I find it easier to remember by “Compress,” even though that’s -z’s job.

创建tar文件也很容易。 只需将-x替换为-c即可“创建”,尽管我发现“压缩”更容易记住,即使那是-z的工作。

一种更简单的方法(在macOS上) (An Easier Way (on macOS))

For those that don’t like using a terminal, you’ll be delighted to hear that macOS can open tar and tar.gz files by default with the Archive Utility. Just double click on the file, and it will extract.

对于不喜欢使用终端的用户,您会很高兴听到macOS可以默认使用Archive Utility打开tar和tar.gz文件。 只需双击该文件,它将解压缩。

You can also use The Unarchiver, which is a free tool for managing archives, functions just like the Archive Utility, and supports .rar files as well.

您还可以使用The Unarchiver ,这是一个免费的工具,用于管理档案,其功能类似于Archive Utility,并且还支持.rar文件。

Windows呢? (What About Windows?)

On Windows, you’ll need an external program to open them. 7-Zip is lightweight and does the job well, though it takes two steps to open tar.gz files. WinRar opens them in one step but is slightly clunkier to use.

在Windows上,您需要一个外部程序来打开它们。 7-Zip轻巧并且可以很好地完成工作,尽管打开tar.gz文件需要两个步骤。 WinRar一步打开它们,但使用起来有点笨拙。

翻译自: https://www.howtogeek.com/362203/what-is-a-tar.gz-file-and-how-do-i-open-it/

.tar.gz文件

  • 4
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值