[root@web01 ~]# yum provides zip
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: hkg.mirror.rackspace.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
zip-3.0-.el7.x86_64 : A file compression and packaging utility compatible
[root@web01 ~]# yum install zip-3.0-.el7.x86_64
[root@web01 www]# zip -r -q wwwroot.zip  wwwroot
[root@web01 www]# ls
backup server wwwlogs wwwroot wwwroot.zip
[root@web01 www]# yum search unzip
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: fedora.cs.nctu.edu.tw
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
======================================= N/S matched: unzip =======================================
perl-PerlIO-gzip.x86_64 : Perl extension to provide a PerlIO layer to gzip/gunzip
unzip.x86_64 : A utility for unpacking zip files
[root@web01 www]# yum install -y unzip.x86_64
[root@web01 /]# unzip wwwroot.zip
压缩
tar –cvf jpg.tar *.jpg //将目录里所有jpg文件打包成tar.jpg tar –czf jpg.tar.gz *.jpg //将目录里所有jpg文件打包成jpg.tar后,并且将其用gzip压缩,生成一 个gzip压缩过的包,命名为jpg.tar.gz tar –cjf jpg.tar.bz2 *.jpg //将目录里所有jpg文件打包成jpg.tar后,并且将其用bzip2压缩,生成一个bzip2压缩过的包,命名为jpg.tar.bz2 tar –cZf jpg.tar.Z *.jpg //将目录里所有jpg文件打包成jpg.tar后,并且将其用compress压缩,生成一个umcompress压缩过的包,命名为jpg.tar.Z rar a jpg.rar *.jpg //rar格式的压缩,需要先下载rar for linux zip jpg.zip *.jpg //zip格式的压缩,需要先下载zip for linux 解压
tar –xvf file.tar //解压 tar包 tar -xzvf file.tar.gz //解压tar.gz tar -xjvf file.tar.bz2 //解压 tar.bz2 tar –xZvf file.tar.Z //解压tar.Z unrar e file.rar //解压rar unzip file.zip //解压zip 总结
()、*.tar 用 tar –xvf 解压
()、*.gz 用 gzip -d或者gunzip 解压
()、*.tar.gz和*.tgz 用 tar –xzf 解压
()、*.bz2 用 bzip2 -d或者用bunzip2 解压
()、*.tar.bz2用tar –xjf 解压
()、*.Z 用 uncompress 解压
()、*.tar.Z 用tar –xZf 解压
()、*.rar 用 unrar e解压
()、*.zip 用 unzip 解压

Centos7下的文件压缩的更多相关文章

  1. Linux下将一个文件压缩分包成多个小文件

    压缩分包 将文件test分包压缩成10M 的文件: tar czf - test | split -b 10m - test.tar.gz 解压 将第一步分拆的多个包解压: cat test.tar. ...

  2. Linux之文件压缩与解压

    文件压缩与解压 1.tar命令 tar命令可以为Linux的文件和目录创建档案. 利用tar,可以为某一特定文件创建档案(备份文件),也可以在档案中改变文件,或者向档案中加入新的文件.tar最初被用来 ...

  3. I/O操作之文件压缩与解压

    与文件压缩与解压相关的类在java.util.zip包下 实例 //文件压缩 import java.io.File; import java.io.FileInputStream; import j ...

  4. java实现将文件压缩成zip格式

    以下是将文件压缩成zip格式的工具类(复制后可以直接使用): zip4j.jar包下载地址:http://www.lingala.net/zip4j/download.php package util ...

  5. Zip文件压缩(加密||非加密||压缩指定目录||压缩目录下的单个文件||根据路径压缩||根据流压缩)

    1.写入Excel,并加密压缩.不保存文件 String dcxh = String.format("%03d", keyValue); String folderFileName ...

  6. linux下文件压缩与解压操作

    对于刚刚接触Linux的人来说,一定会给Linux下一大堆各式各样的文件名给搞晕.别个不说,单单就压缩文件为例,我们知道在Windows下最常见的压缩文件就只有两种,一是,zip,另一个是.rap.可 ...

  7. Linux下对各种压缩文件处理

    Linux下最常用的打包程序就是tar了,使用tar程序打出来的包我们常称为tar包,tar包文件的命令通常都是以.tar结尾的.生成tar包后,就可以用其它的程序来进 行压缩了,所以首先就来讲讲ta ...

  8. ubuntu下文件压缩/解压缩命令总结

    .gz 解压1:gunzip FileName.gz 解压2:gzip -d FileName.gz 压缩:gzip FileName .tar.gz 解压:tar zxvf FileName.tar ...

  9. Centos7下GlusterFS 分布式文件系统环境搭建

    Centos7下 GlusterFS 环境搭建准备工作glusterfs-3.6.9.tar.gzuserspace-rcu-master.zip三台服务器:192.168.133.53.192.16 ...

随机推荐

  1. centos-限制ssh访问

    hosts.allow和hosts.deny规则的执行者为TCP wrappers,对应守护进程为tcpd:而tcpd执行依赖于程序使用了libwrap库. 也就是说:hosts.allow和host ...

  2. abp记录1

    1在AbpWebApplication中的的构造函数中创建abpBootstrapper 实例,在Application_Start执行AbpBootstrapper值初始化方式 2AbpBootst ...

  3. param动作

    param动作通常与forword一起使用 <jsp:forword page="目标页面" > <jsp:param value="参数值" ...

  4. w5500驱动使用方法调试笔记

    1.w5500有两种方式可以运行的,server端一般用中断的方式,效率比较高,client使用查询的模式,本身自带2k的发送缓存和2k的接收缓存.2.查询模式:有数据的时候,查询模式可以每隔一段时间 ...

  5. What is the difference between Reactjs and Rxjs?--React is the V (View) in MVC (Model/View/Controller).

    This is really different, React is view library; and Rxjs is reactive programming library for javasc ...

  6. Performance --- 前端性能监控

    阅读目录 一:什么是Performance? 二:使用 performance.timing 来计算值 三:前端性能如何优化? 四:Performance中方法 五:使用performane编写小工具 ...

  7. Educational Codeforces Round 47 (Rated for Div. 2) G. Allowed Letters

    把原字符看成 $X$,每个位置看成 $Y$,每种字符向每个能去的位置连边,就成了一个二分图完美匹配的问题.现要得到字典序最小,那么就枚举每一位要放什么,然后看放完这种字符,剩下的字符的个数和后面能不能 ...

  8. 【每天学一点linux】后台进程不打印日志

    command > out.file 2>&1 & 将文件输出到指定的文件中

  9. Python爬虫selenium中get_cookies()和add_cookie()的用法

    在用selenium爬取网页的时候,有时候需要登陆,这时候用selenium获取cookie和携带cookie是很方便的,获取cookie可以通过内置的函数get_cookies(),它得到的是一组c ...

  10. JS的ES6的class

    1.类的创建: 定义类 类的构造函数 类的静态方法 类的一般属性和方法 //定义类 class Person{ // 类的静态方法,相当于Person.test = function(){consol ...