tar和zip的区别是什么?每个用例是什么?
Tar本身只是将文件捆绑在一起(结果称为tarball),而zip也应用压缩。
通常使用gzip和tar来压缩生成的tarball,从而获得与使用zip类似的结果。
然而,对于相当大的档案,有重要的区别。压缩档案是压缩文件的集合。gzip的tar是一个压缩的集合(未压缩的文件)。因此,zip归档是一个随机可访问的连接压缩项列表,而.tar.gz是一个必须在目录可访问之前完全展开的归档。
The caveat of a zip is that you don't get compression across files (because each file is compressed independent of the others in the archive, the compression cannot take advantage of similarities among the contents of different files); the advantage is that you can access any of the files contained within by looking at only a specific (target file dependent) section of the archive (as the "catalog" of the collection is separate from the collection itself). The caveat of a .tar.gz is that you must decompress the whole archive to access files contained therein (as the files are within the tarball); the advantage is that the compression can take advantage of similarities among the files (as it compresses the whole tarball).
推荐文章
- 在Bash中获取日期(比当前时间早一天)
- Linux: kill后台任务
- 在OSX中永久设置PATH环境变量
- 如何在C程序中获取当前目录?
- 如何在Bash中逐行合并两个文件
- 如何从远程SSH会话发送数据到本地剪贴板
- 我如何得到bash完成工作与别名?
- Gzip的JavaScript实现
- SSH端口转发~/。ssh /配置文件?
- 如何将多个文件的内容追加到一个文件
- 如何进入每个目录并执行命令?
- Tar归档,从文件列表中获取输入
- 如何复制文件跨计算机使用SSH和MAC OS X终端
- 为什么对Apache提供的文本文件使用deflate而不是gzip ?
- 如何在Bash脚本中使用密码执行sftp命令?