如何解压Gz文件
source link: https://www.myfreax.com/how-to-unzip-gz-file/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
如何解压Gz文件
Gzip是一种流行的压缩算法,可在保持原始文件模式,所有权和时间戳的同时减小文件大小
如何解压Gz文件
Gzip是一种流行的压缩算法,可在保持原始文件模式,所有权和时间戳的同时减小文件大小。此算法通常用于压缩Web页面,以加快页面加载速度。
在Linux和macOS,您可以使用gzip
命令解压.gz
文件。gzip命令会将压缩文件恢复到原始状态,并删除.gz
文件。
按照惯例,使用gzip压缩的文件以.gz 或.z结尾。本教程说明如何打开或解压.gz
文件。
解压gz文件
如在引言提到,gzip命令在解压完成后,将会删除原始的压缩文件。如果你需要保留压缩文件,请使用gzip命令的-k
选项解压文件。
另一个可用于解压.gz文件的命令是gunzip
。gunzip
命令实质是命令gzip -d
的别名。
要使用gunzip
命令解压.gz
文件,只需将文件名传递给gunzip
命令,例如命令gunzip file.gz
,gunzip
默认不会删除原始压缩文件。
如果您使用的是GUI环境,而不是命令行,则可以使用文件管理器。打开或者解压.gz
文件,请右键单击要解压缩的文件,然后选择提取
。
Windows用户需要安装7zip才能解压.gz
文件。
gzip -dk file.gz
gunzip file.gz
tar 命令解压tar.gz文件
要解压tar.gz
文件,请tar
命令的使用--extract
或者-x
选项,并在-f
选项后指定tar.xz
文件文件名称。
tar
自动检测压缩文件使用的算法并自动解压文件。可以使用tar -xf
命令来解压使用其他压缩算法的tar存档文件。例如.tar.xz
文件和.tar.bz
文件。
命令tar -xf archive.tar.gz
命令将会解压archive.tar.gz文件到当前目录。-f
选项用于指定文件,-x
选项表示解压。
tar -xf archive.tar.gz
要解压.gz
文件,请使用gunzip
命令后跟文件名。如有任何疑问,请在下面发表评论。
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK