-bash: unzip: 未找到命令

首先查看下自己系统:

$ cat /proc/version
Linux version 3.10.0-957.10.1.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (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 -h
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 (-qq => 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

mac os:

使用命令 brew install -y unzip

 

 

 

 

今日精选推荐

JMeter接口测试-if控制器

JMeter数据库操作

Jmeter接口测试-正则表达式

JMeter中文返回乱码

Jmeter接口测试-参数化

JMeter接口测试-基础

测试-感想

 

 

扫描二维码方便拉进群交流

请猛戳下面二维码了解更多加vx公众号

 

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值