<svg xmlns="http://www.w3.org/2000/svg" style="display: none"> <path stroke-linecap="round" d="M5,0 0,2.5 5,5z" id="raphael-marker-block" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0)"></path> </svg> <blockquote>
讯享网
今天使用linux解压的时候遇到了不能解压的问题,然后就看了一些文档,写一个解决方案
讯享网
Linux version 3.10.0-957.10.1.el7.x86_64 () (gcc version 4.8.5 (Red Hat 4.8.5-36) (GCC) ) #1 SMP Mon Mar 18 15:06:45 UTC 2019
当执行unzip 提示如下:
-bash: unzip: 未找到命令
说明未安装过, 只需执行如下命令即可. 同样适用 Unix 内核系统.
一. Install 安装
[root@dev-redis agent]# yum install -y unzip zip
已加载插件:fastestmirror
Determining fastest mirrors
epel/x86_64/metalink | 8.3 kB 00:00:00
- base: mirrors.cn99.com
- epel: mirrors.aliyun.com
- extras: ftp.sjtu.edu.cn
- updates: mirrors.aliyun.com
base | 3.6 kB 00:00:00
docker-ce-stable | 3.5 kB 00:00:00
epel | 5.3 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
(1⁄4): epel/x86_64/updateinfo | 976 kB 00:00:00
(2⁄4): epel/x86_64/primary_db | 6.7 MB 00:00:00
(3⁄4): extras/7/x86_64/primary_db | 200 kB 00:00:00
(4⁄4): updates/7/x86_64/primary_db | 5.7 MB 00:00:00
正在解决依赖关系
–> 正在检查事务
—> 软件包 unzip.x86_64.0.6.0-19.el7 将被 安装
—> 软件包 zip.x86_64.0.3.0-11.el7 将被 安装
–> 解决依赖关系完成
依赖关系解决
===========================================================================================================================================================================================
Package 架构 版本 源 大小
===========================================================================================================================================================================================
正在安装:
unzip x86_64 6.0-19.el7 base 170 k
zip x86_64 3.0-11.el7 base 260 k
事务概要
===========================================================================================================================================================================================
安装 2 软件包
总下载量:430 k
安装大小:1.1 M
Downloading packages:
(1⁄2): unzip-6.0-19.el7.x86_64.rpm | 170 kB 00:00:00
(2⁄2): zip-3.0-11.el7.x86_64.rpm | 260 kB 00:00:00
总计 2.6 MB/s | 430 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : zip-3.0-11.el7.x86_64 1⁄2
正在安装 : unzip-6.0-19.el7.x86_64 2⁄2
验证中 : unzip-6.0-19.el7.x86_64 1⁄2
验证中 : zip-3.0-11.el7.x86_64 2⁄2
已安装:
unzip.x86_64 0:6.0-19.el7 zip.x86_64 0:3.0-11.el7
完毕!
到这里就安装完毕可以使用unzip 了
二. 查看用法
然后可以查看下相关用法:
UnZip 6.00 of 20 April 2009, by Info-ZIP. Maintained by C. Spieler. Send
bug reports using http://www.info-zip.org/zip-bug.html; see README for details.
Usage: unzip [-Z] [-opts[modifiers]] file[.zip] [list] [-x xlist] [-d exdir]
Default action is to extract files in list, except those in xlist, to exdir;
file[.zip] may be a wildcard. -Z => ZipInfo mode (“unzip -Z” for usage).
-p extract files to pipe, no messages -l list files (short format)
-f freshen existing files, create none -t test compressed archive data
-u update files, create if necessary -z display archive comment only
-v list verbosely/show version info -T timestamp archive to latest
-x exclude files that follow (in xlist) -d extract files into exdir
modifiers:
-n never overwrite existing files -q quiet mode (- => quieter)
-o overwrite files WITHOUT prompting -a auto-convert any text files
-j junk paths (do not make directories) -aa treat ALL files as text
-U use escapes for all non-ASCII Unicode -UU ignore any Unicode fields
-C match filenames case-insensitively -L make (some) names lowercase
-X restore UID/GID info -V retain VMS version numbers
-K keep setuid/setgid/tacky permissions -M pipe through “more” pager
-O CHARSET specify a character encoding for DOS, Windows and OS/2 archives
-I CHARSET specify a character encoding for UNIX and other archives
See “unzip -hh” or unzip.txt for more help. Examples:
unzip data1 -x joe => extract all files except joe from zipfile data1.zip
unzip -p foo | more => send contents of foo.zip via pipe into program more
unzip -fo foo ReadMe => quietly replace existing ReadMe if archive file newer
解压命令大全
讯享网

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/166194.html