linux 文件压缩与解压
来源:互联网 发布:国企混改 知乎 编辑:程序博客网 时间:2024/06/05 03:01
文件压缩与解压
文件的压缩与解压,也是我们日常中经常用到的操作,如,我们会经常从网上下载各种文件进行进行安装,而大部分文件都是经过压缩的。
下面来学习四个常用的压缩命令。
gzip
特点:
1.只能压缩文件,不能压缩目录
2.不保留源文件
[root@localhost test]#
gzip aaa 将aaa文件进行压缩
[root@localhost test]#
gunzip aaa.gz 将aaa.gz文件进行解压
[root@localhost test]#
gzip -d aaa.gz 作用同上
tar
tar类型的的压缩文件应该是大家最常见的吧,在网上下的好多软件也是这种格式的。
参数:
-x解包.tar文件
-v 显示详细信息
-f 指定解压文件
-z 解压缩
[root@localhost test]#
tar -zcvf tatga.tar.gz tatgz 压缩tatgz文件夹为tatga.tar.gz压缩文件
注意:
在linux下扩展名不是标识文件的属性
[root@localhost test]#
file [文件名] 查看任何一个文件的类型
[root@localhost test]#
tar -cf tatga.tar tatgz 对tatgz文件打包
[root@localhost test]#
gzip tatga.tar 对tatga.tar包文件压缩
[root@localhost test]#
tar -zxvf tatga.tar.gz 对压缩文件进行解压
zip
功能:可以压缩文件和目录,是windows
和linux 通用的压缩格式
[root@localhost test]#
zip a.zip a 把a文件压缩成a.zip
[root@localhost test]#
zip -r tatgz.zip tatgz 压缩tatgz目录为tatgz.zip
[root@localhost test]#
unzip tatgz.zip 解压文件
bzip2
和gzip功能基本相同
只能压缩文件
用 -k 命令可以保留原文件
[root@localhost
bzip2]# bzip2 -k fnngj 对fnngj文件进行压缩
[root@localhost
bzip2]# bunzip2 fnngj.bz2 对压缩文件fnngj.bz2进行解压
- Linux文件压缩与解压
- Linux文件压缩与解压
- linux文件压缩与解压
- linux 文件压缩与解压
- Linux 文件压缩与解压
- Linux文件压缩与解压命令
- linux命令集-文件压缩与解压
- linux文件压缩与解压.txt
- Linux 文件的压缩与解压
- linux 文件解压与压缩常用命令
- linux下 文件压缩与解压
- Linux下如何压缩与解压文件
- LINUX之文件解压与压缩汇总
- Linux文件压缩与解压总结
- Linux文件的压缩与解压
- linux压缩解压文件
- LINUX压缩、解压文件
- Linux 文件压缩、解压
- Elasticsearch 5.0 磁盘空间节省策略的认识
- Spring如何加载XSD文件(org.xml.sax.SAXParseException: Failed to read schema document错误的解决方法)
- Android JNI demo编译遇到的错误
- java之git
- Tomcat学习1
- linux 文件压缩与解压
- RPL(2):RFC6550翻译(2)---术语
- 将整个文本处理成一行一个单词的形式
- Spring Boot 过滤器、监听器
- 林语堂:为什么现代教育培养不出有见识的人?
- 计网——各层功能
- UINavgationController中覆写preferredStatusBarStyle方法不执行的问题
- 你的26周岁,可还好?
- Android ButterKnife的简单例子