1.zip命令

例如:zip -r mysql.zip mysql 该句命令的含义是:将mysql文件夹压缩成mysql.zip

zip -r abcdef.zip abc def.txt 这句命令的意思是将文件夹abc和文件def.txt压缩成一个压缩包abcdef.zip

2.unzip命令

与zip命令相反,这是解压命令,用起来很简单。 如:unzip mysql.zip 在当前目录下直接解压mysql.zip。

[root@localhost test]# ls
a.txt mysql
[root@localhost test]# zip mysql.zip mysql
adding: mysql/ (stored 0%)
[root@localhost test]# ls
a.txt mysql mysql.zip
[root@localhost test]# rm -rf mysql
[root@localhost test]# ls
a.txt mysql.zip
[root@localhost test]# unzip mysql.zip
Archive: mysql.zip
creating: mysql/
[root@localhost test]# ls
a.txt mysql mysql.zip
[root@localhost test]#

  

[root@localhost test]# ls
a.txt mysql mysql.zip
[root@localhost test]# rm -rf mysql.zip
[root@localhost test]# ls
a.txt mysql
[root@localhost test]# zip -r a.txt mysql/
zip warning: missing end signature--probably not a zip file (did you
zip warning: remember to use binary mode when you transferred it?)
zip warning: (if you are trying to read a damaged archive try -F) zip error: Zip file structure invalid (a.txt)
[root@localhost test]# zip -r test.zip a.txt mysql/
adding: a.txt (stored 0%)
adding: mysql/ (stored 0%)
[root@localhost test]# ls
a.txt mysql test.zip
[root@localhost test]# rm -rf a.txt mysql/
[root@localhost test]# ls
test.zip
[root@localhost test]# unzip test.zip
Archive: test.zip
extracting: a.txt
creating: mysql/
[root@localhost test]# ls
a.txt mysql test.zip
[root@localhost test]#

  

linux 压缩命令 zip的更多相关文章

  1. Linux常用命令学习3---(文件的压缩和解压缩命令zip unzip tar、关机和重启命令shutdown reboot……)

    1.压缩和解压缩命令    常用压缩格式:.zip..gz..bz2..tar.gz..tar.bz2..rar .zip格式压缩和解压缩命令        zip 压缩文件名 源文件:压缩文件   ...

  2. 【转载】 Linux常用命令: zip、unzip 压缩和解压缩命令

    Linux常用命令: zip.unzip 压缩和解压缩命令   Linux常用命令: zip.unzip 压缩和解压缩命令 zip的用法 基本用法是: zip [参数] [打包后的文件名] [打包的目 ...

  3. Linux压缩命令(zip/gz/bz2/tar/tar.gz/tar.bz2)

    一.Linux的压缩格式 .zip . gz . bz2    .tar 1..zip格式(Linux和Windows是可以互传的) 压缩命令 语法:zip 文件名.zip 文件名  ------压缩 ...

  4. Linux常用命令: zip、unzip 压缩和解压缩命令

    zip基本用法是: zip [参数] [打包后的文件名] [打包的目录路径] 常用参数: -a 将文件转成ASCII模式 -F 尝试修复损坏的压缩文件 -h 显示帮助界面 -m 将文件压缩之后,删除源 ...

  5. Linux下的压缩和解压缩命令——zip/unzip

    zip命令 zip是个使用广泛的压缩程序,文件经它压缩后会另外产生具有".zip"扩展名 的压缩文件. 选项: -A   调整可执行的自动解压缩文件. -b<工作目录> ...

  6. Linux压缩命令

    Linux常见的压缩格式有.zip..gz..bz2..tar..tar.gz..tar.bz2:常用的压缩命令有zip.tar.这里列举了各压缩命令的使用示例.更多的用法请使用命令 --help查阅 ...

  7. Linux压缩命令总结

    2018-02-28  10:43:18 linux压缩和解压缩命令大全 tar命令:tar本身仅是一个打包的命令,不具有压缩的功能.打包后源文件仍然存在,具有将多个文件归档成一个文件的功能[root ...

  8. linux 压缩命令

    .zip格式压缩 zip 压缩文件名 源文件     压缩文件 zip -r 压缩文件名 源目录    #压缩目录 .zip格式解压缩 unzip 压缩文件     #解压缩 .gz格式压缩 gzip ...

  9. Linux —— 压缩命令

    压缩与解压命令 .zip格式 压缩文件: zip 压缩文件名 原文件名 (压缩目录添加 -r) 解压缩文件/目录: unzip .zip压缩包 .gz格式 压缩文件: gzip 原文件名称 压缩文件为 ...

随机推荐

  1. 论文:Show and Tell: A Neural Image Caption Generator-阅读总结

    Show and Tell: A Neural Image Caption Generator-阅读总结 笔记不能简单的抄写文中的内容,得有自己的思考和理解. 一.基本信息 标题 作者 作者单位 发表 ...

  2. [HDU2553]N皇后问题(DFS)

    题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=2553 题意 n<=10,输出N皇后问题的方法数. 题解 可以使用各种方法.这里使用DFS. 使用 ...

  3. kafka学习(三)kafka生产者,消费者详解

    文章更新时间:2020/06/14 一.生产者 当我们发送消息之前,先问几个问题:每条消息都是很关键且不能容忍丢失么?偶尔重复消息可以么?我们关注的是消息延迟还是写入消息的吞吐量? 举个例子,有一个信 ...

  4. Redis学习(四)redis发布订阅

    文章更新时间:2020/04/22 一.简介 Redis 发布订阅(pub/sub)是一种消息通信模式:发送者(pub)发送消息,订阅者(sub)接收消息. Redis 客户端可以订阅任意数量的频道. ...

  5. js实现表单验证

    <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...

  6. NX导入DWG失败

    给客户开发的NX导入DWG图纸功能,部分电脑偶尔出现导入失败的情况,且几乎没有规律可言.客户无法理解,坚持认为是代码的问题,毕竟使用的是我们二次开发的功能.我本机没有问题,在某些出问题的电脑上也尝试多 ...

  7. 【Processing日常2】群星1

    之前在CSDN上发表过: https://blog.csdn.net/fddxsyf123/article/details/79747064

  8. linux循环定时任务

    crond定时任务 centos # 重启服务 service crond restart ----------------------------------------- chkconfig cr ...

  9. ES 入门 - 基于词项的查询

    准备 首先先声明下,我这里使用的 ES 版本 5.2.0. 为了便于理解,这里以如下 index 为格式,该格式是通过 PMACCT 抓取的 netflow 流量信息, 文中所涉及的到的例子,全基于此 ...

  10. NodeJS二进制合并

    Node.js 批量文件合并code cnblogs @ Orcim  本 文主要介绍使用 Node 进行 ACB 序列文件(Atom CueSheet Binary,编译 AtomCueSheet ...