【发布时间】:2015-02-20 19:02:39
【问题描述】:
如果我正在运行 7z a -tzip myDestFile.zip some/dir 命令并且我想向它添加一个文件扩展名白名单,这样如果我输入 *.txt *.xls *.doc,它只会将具有这些扩展名的文件添加到存档中,我该怎么做?该文档在通过单个扩展名列入白名单方面做得很好,但是多个呢?我是否只需要在脚本中多次运行该命令?
我尝试了以下方法:
7za a -tzip test.zip ./subdir *.txt *.xlsx # throws error
7za a -tzip test.zip ./subdir -i!./*.txt -i!./*.xlsx # also results in error
7za a -tzip test.zip ./subdir -i!*.txt -i!*.xlsx # also results in error
【问题讨论】:
-
没关系,如果我在每个扩展中包含完整的子目录,这将有效。包含在主帖中的示例。
标签: file-extension 7zip whitelist