[命令] Linux 命令 gunzip (打包、解包、压缩和解压文件或目录,压缩包以 xz 作为后缀)

内容一:gunzip 命令简介

1.1 gunzip 命令的格式

# gunzip <option> <file>

1.2 gunzip 命令的常用选项

1) -c or –stdout, write on standard output, keep original files unchanged
2) -d or –decompress, decompress
3) -f or –force, force overwrite of output file and compress links
4) -h or –help, give this help
5) -k or –keep, keep (don’t delete) input files
6) -l or –list, list compressed file contents
7) -n or –no-name, do not save or restore the original name and timestamp
8) -N or –name, save or restore the original name and timestamp
9) -q or –quiet, suppress all warnings
10) -r or –recursive or –rsyncable, operate recursively on directories
11) -t or –test, test compressed file integrity
12) -1 or –fast, compress faster
13) -9 or –best, compress better

内容二:gunzip 命令的使用案例

2.1 案例一:压缩文件

# gunzip test.txt

(补充:这里以压缩文件 test.txt 为例)

2.2 案例二:解压文件

# gunzip -d test.txt.xz

(补充:这里以解压文件 test.txt.zx 为例)

[排错] RHEL 解决使用 yum 命令时卡住

报错代码

# yum update 
Updating Subscription Management repositories.
Unable to read consumer identity

可尝试的解决方法一:修改 /etc/yum/pluginconf.d/subscription-manager.conf 文件

# vim /etc/yum/pluginconf.d/subscription-manager.conf

将以下内容:

......
[main] 
enabled=1
......

修改为:

......
[main] 
enabled=0
......

可尝试的解决方法二:安装对应的 katello-ca-consumer-latest.noarch.rpm 软件包

(步骤略)

(补充:katello-ca-consumer-latest.noarch.rpm 软件包下载自对应的 Red Hat Satellite 服务器,补充链接:Red Hat Satellite client register