如何为zip文件添加注释

时间:2018-05-22 02:58:24

标签: zip comments

我有几天研究过,发现我们可以在zip文件中添加一些包含一些内容的文件然后再压缩它。然后评论将被添加到zip文件中,但我不知道该文件到底是什么,所以任何人都知道为zip(压缩)文件添加注释的原则

3 个答案:

答案 0 :(得分:1)

.row参数可让您以交互方式为zip中的每个文件添加一行注释。例如。 -c

zip -c valid.zip somefile.txt参数可让您以交互方式为整个zip存档添加多行注释。例如。 -z

答案 1 :(得分:0)

阅读您的zip版本手册。在Macintosh上,-c参数将允许您添加注释行。

答案 2 :(得分:0)

要在命令行中使用,请将每个文件的注释(-c)和/或每个zip的注释(-z)输入stdin。当同时使用时,请先输入每个文件的注释(每行一行),然后输入每个zip注释行。示例:

$ touch one.txt two.txt

$ zip -c -z commented.zip one.txt two.txt <<END
> Comment for one
> Comment for two
> Remaining lines are zip-level comment
> lines. There can be more than one line here.
> End with a dot:
> .
> END
  adding: one.txt (stored 0%)
  adding: two.txt (stored 0%)
Enter comment for one.txt:
Enter comment for two.txt:
enter new zip file comment (end with .):

$ unzip -l commented.zip 
Archive:  commented.zip
Remaining lines are zip-level comment
lines. There can be more than one line here.
End with a dot:
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  11-13-2019 10:06   one.txt
Comment for one
        0  11-13-2019 10:06   two.txt
Comment for two
---------                     -------
        0                     2 files