用shell压缩多个文件夹为zip

发布网友

我来回答

3个回答

热心网友

压缩为bcd.zip,保存在a文件夹中,如果要静默模式,zip命令加-q选项。

文件格式:

另指计算机文件压缩算法,原名真空,发明者为菲尔·卡茨,他于19年1月公布了该格式的资料。

标准 ZIP 压缩文件格式分析:标准 zip 文件格式由三部分组成:zip 压缩数据段、*目录区、*目录区尾部。其中 zip 压缩数据段又分为 zip 文件头信息和压缩数据。如图 1、2、3 所示。带☆的是在文件修复中经常用到的。

扩展资料:

命令参数:

Copyright (C) 1990-1999 Info-ZIP

Type 'zip "-L"' for software license。

Zip 2.3 (November 29th 1999). Usage。

zip [-options] [-b path] [-t mmddyyyy] [-n suffixes] [zipfile list] [-xi list]。

The default action is to add or replace zipfile entries from list, which。

can include the special name - to compress standard input。

If zipfile and list are omitted, zip compresses stdin to stdout。

-f freshen: only changed files -u update: only changed or new files。

参考资料来源:百度百科-Zip


热心网友

cd a
zip -r bcd b c d

压缩为bcd.zip,保存在a文件夹中。

如果要静默模式,zip命令加-q选项。

 

解压到当前目录:

unzip bcd.zip

追问路径怎加入,比如e文件夹中有a文件夹,a中才有bcd文件夹呢

追答不知道你当前目录是什么,请写绝对路径:
cd /e/a #假设e文件夹在根目录下

热心网友

cd a && tar -czvf a.tar.gz b/* c/* d/*
如果是要zip格式的话这样
zip -r a.zip b c d

参数 -r 递归处理,将指定目录下的所有文件和子目录一并处理。追问路径怎写的

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com