码迷,mamicode.com
首页 > 系统相关 > 详细

ubuntu下zip文件操作

时间:2018-07-09 10:59:45      阅读:185      评论:0      收藏:0      [点我收藏+]

标签:操作   log   details   pre   code   div   压缩文件   style   unzip   

转自
https://blog.csdn.net/hpu11/article/details/71524013


 1.zip
$ zip -r myfile.zip ./*
将当前目录下的所有文件和文件夹全部压缩成myfile.zip文件,-r表示递归压缩子目录下所有文件.

2.unzip
$ unzip -o -d /home/sunny myfile.zip
把myfile.zip文件解压到 /home/sunny/
-o:不提示的情况下覆盖文件;
-d:-d /home/sunny 指明将文件解压缩到/home/sunny目录下;

3.其他
$ zip -d myfile.zip smart.txt
删除压缩文件中smart.txt文件
$ zip -m myfile.zip ./rpm_info.txt
向压缩文件中myfile.zip中添加rpm_info.txt文件

-------------------------------------------------------------------------------

要使用 zip 来压缩文件,在 shell 提示下键入下面的命令:

zip -r filename.zip filesdir

 

ubuntu下zip文件操作

标签:操作   log   details   pre   code   div   压缩文件   style   unzip   

原文地址:https://www.cnblogs.com/fply/p/9282045.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!