Centos7下的文件压缩
2024-09-02 08:29:27
[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 解压
最新文章
- JPA中entityManager的CRUD
- struts中Cookie实现记住密码
- angular ng-model类型格式转化
- eclipse for jee版配置tomcat
- 转--优化临时表使用,SQL语句性能提升100倍
- WinCacheGrind配合XDebug分析PHP程序性能
- MySQL中的类Decode用法
- java.io.FileNotFoundException: /exapp/hadoop/name/current/VERSION (Permission denied)
- cookie记录用户的浏览商品的路径
- Anyterm - Introduction
- cocos2d-x 移植android竖,横屏设置
- CSS3(transform/transition/animation) 基础 总结
- redis3--key的操作
- SqlServer如何给表添加新的字段以及字段注释
- Linux安装网易云音乐
- 13_文件系统访问列表_case语句及脚本选项
- 嵌入式Linux系统的构成和启动过程
- linux下查看php-fpm是否开启以及如何开启
- 《Linux内核分析》第三周:Linux系统启动过程
- JavaWeb基础—CSS学习小结