每天回顾linux命令(unzip)
来源:互联网 发布:时代网络大厦 联想电脑 编辑:程序博客网 时间:2024/06/14 00:30
unzip命令
unzip命令用于解压由zip命令压缩的“.zip”压缩包。
语法
unzip (选项) (参数)
选项
-c:将解压的结果显示到屏幕上,并对字符做适当的转换;
root@35d388cf883b:/home/wzm/testgzip/zip# cat testzip123abcroot@35d388cf883b:/home/wzm/testgzip/zip# zip test.zip testzip adding: testzip (stored 0%)root@35d388cf883b:/home/wzm/testgzip/zip# unzip -c test.zipArchive: test.zip extracting: testzip123abcroot@35d388cf883b:/home/wzm/testgzip/zip#
-f:更新现有的文件。
-l:显示压缩文件内所包含的文件。
root@35d388cf883b:/home/wzm/testgzip/ret# unzip -l test.zipArchive: test.zip Length Date Time Name--------- ---------- ----- ---- 0 2017-11-21 03:19 zip/ 57764 2017-11-20 01:26 zip/redis.conf 0 2017-11-21 02:25 zip/addfile.txt 8 2017-11-21 02:11 zip/.testzip--------- ------- 57772 4 filesroot@35d388cf883b:/home/wzm/testgzip/ret#
-p:和-c参数类似,会将解压的结果显示到屏幕上,但不会执行任何的转换;
-t:检查压缩文件是否正确。
root@35d388cf883b:/home/wzm/testgzip/ret# unzip -t test.zipArchive: test.zip testing: zip/ OK testing: zip/redis.conf OK testing: zip/addfile.txt OK testing: zip/.testzip OKNo errors detected in compressed data of test.zip.root@35d388cf883b:/home/wzm/testgzip/ret#
-u:和-f参数类似,但是除了更新现有的文件外,也会将压缩文件中的其他文件压缩到目录中;
root@35d388cf883b:/home/wzm/testgzip/ret# unzip -u test.zipArchive: test.zip creating: zip/ inflating: zip/redis.conf extracting: zip/addfile.txt extracting: zip/.testziproot@35d388cf883b:/home/wzm/testgzip/ret# lstest.zip ziproot@35d388cf883b:/home/wzm/testgzip/ret#
-v:执行时显示详细的信息
root@35d388cf883b:/home/wzm/testgzip/ret# unzip -v test.zipArchive: test.zip Length Method Size Cmpr Date Time CRC-32 Name-------- ------ ------- ---- ---------- ----- -------- ---- 0 Stored 0 0% 2017-11-21 03:19 00000000 zip/ 57764 Defl:X 19974 65% 2017-11-20 01:26 6a80b091 zip/redis.conf 0 Stored 0 0% 2017-11-21 02:25 00000000 zip/addfile.txt 8 Stored 8 0% 2017-11-21 02:11 bd2b0b01 zip/.testzip-------- ------- --- ------- 57772 19982 65% 4 filesroot@35d388cf883b:/home/wzm/testgzip/ret#
-z:仅显示压缩文件的备注文件。
root@35d388cf883b:/home/wzm/testgzip/ret# unzip -z test.zipArchive: test.ziproot@35d388cf883b:/home/wzm/testgzip/ret#
-a:对文本进行必要的字符转换
-b:不要对文本进行必要的字符转换
-C:压缩文件的的文件名称区分大小写
-j:不处理压缩文件中原有的目录路径
-L:将压缩文件中的全部文件名改为小写
-n:解压缩时不覆盖原有的文件;
-o:不必先询问用户,覆盖原有文件
root@35d388cf883b:/home/wzm/testgzip/ret# unzip test.zipArchive: test.zipreplace zip/Testzip? [y]es, [n]o, [A]ll, [N]one, [r]ename:root@35d388cf883b:/home/wzm/testgzip/ret# unzip -o test.zip Archive: test.zip extracting: zip/Testzip inflating: zip/redis.conf extracting: zip/addfile.txt root@35d388cf883b:/home/wzm/testgzip/ret#
-p密码:使用zip的密码选项
-q:执行时不显示任何信息
root@35d388cf883b:/home/wzm/testgzip/ret# rm zip -rroot@35d388cf883b:/home/wzm/testgzip/ret# unzip -q test.ziproot@35d388cf883b:/home/wzm/testgzip/ret# rm zip -rroot@35d388cf883b:/home/wzm/testgzip/ret# unzip test.zipArchive: test.zip creating: zip/ extracting: zip/Testzip inflating: zip/redis.conf extracting: zip/addfile.txtroot@35d388cf883b:/home/wzm/testgzip/ret#
-s:将文件名中的空白字符转换为底线字符
-X:解压的同事回存文件原来的UID/GID
-d 目录:指定文件压缩后所要存储的目录
-x 文件:指定不要处理.zip压缩文件中的哪些文件。
阅读全文
0 0
- 每天回顾linux命令(unzip)
- 每天回顾linux命令(ls)
- 每天回顾linux命令(cd)
- 每天回顾linux命令(mv)
- 每天回顾linux命令(mkdir)
- 每天回顾linux命令(wc)
- 每天回顾linux命令(diff)
- 每天回顾linux命令(touch)
- 每天回顾linux命令(cut)
- 每天回顾linux命令(split)
- 每天回顾linux命令(tr)
- 每天回顾linux命令(grep)
- 每天回顾linux命令(which)
- 每天回顾linux命令(whereis)
- 每天回顾linux命令(sort)
- 每天回顾linux命令(uniq)
- 每天回顾linux命令(unlink)
- 每天回顾linux命令(ldd)
- JAVA入门学习(四)
- 打包出现这个错误Error:A problem was found with the configuration of task ':app:packageRelease'.
- 用java代码写的简易计算器(可以实现基本的加减乘除功能)
- poi读取Excel内容
- flex自动导入包
- 每天回顾linux命令(unzip)
- Numpy快速入门教程(一):数组创建与数组访问
- ThinkPHP5/PHP 使用TCPDF 生成PDF文件
- SpringMVC学习之服务器端校验
- SparkStreaming之单词计数实现在一次程序的运行中,两次发送相同的key可以进行累加
- Java抽象类 详解
- 快速排序算法及C++编程
- web前端 网络优化学习笔记
- 读书05《布赞学习技巧——思维导图》