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. Minimizing maximizer(POJ 1769)

    原题如下: Minimizing maximizer Time Limit: 5000MS   Memory Limit: 30000K Total Submissions: 5104   Accep ...

  2. 记一次 node 项目重构改进

    摘要:经常听到有祖传的代码一说,就是一些项目经过了很长时间的维护,经过了很多人之手,业务逻辑堆叠的越来越多,然后就变成了一个越来越难以维护. 经常听到有祖传的代码一说,就是一些项目经过了很长时间的维护 ...

  3. python 3 for与while嵌套

  4. js 去掉字符串最后一个逗号:笑死我了

    今天突然遇到js 去掉字符串最后一个逗号的问题,本想偷懒搜个代码吧,没想到看到百度的第一条记录是这么一篇文章. 网易博客: http://blog.163.com/li_crane/blog/stat ...

  5. spring boot 源码之SpringApplicationRunListeners

    SpringApplicationRunListeners SpringApplicationRunListener的集合,内部存储了SpringApplicationRunListener的集合,提 ...

  6. 1.2Hadoop概述

  7. JVM学习(七)JMM内存模型

    一.什么是JMM 概念:Java内存模型(Java Memory Model ,JMM)就是一种符合内存模型规范的,屏蔽了各种硬件和操作系统的访问差异的,保证了Java程序在各种平台下对内存的访问都能 ...

  8. xss利用——BeEF#stage1

    全文概览 简介 BeEF( The Browser Exploitation Framework) 是由Wade Alcorn 在2006年开始创建的,至今还在维护.是由ruby语言开发的专门针对浏览 ...

  9. Linux的MySQL安装方法

    第一种: APT方式安装 在ubuntu系统的apt软件仓库中,默认存在MySQL数据库 在用户模式下使用命令:  apt/apt-get install mysql-server mysql-cli ...

  10. springboot整合Mangodb实现crud,高级查询,分页,排序,简单聚合

    //linux安装mangodb教程:https://www.cnblogs.com/yangxiaohui227/p/11347832.html 1.引入maven 依赖 <dependenc ...