【问题标题】:7zip CLI whitelist files to add by extension7zip CLI 白名单文件以按扩展名添加
【发布时间】: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


【解决方案1】:

此问题不应保持开放状态。对我有用的答案如下:

7za a -tzip test.zip ./*.txt ./*.xlsx

【讨论】:

    猜你喜欢
    • 2015-08-04
    • 2012-03-10
    • 2012-12-24
    • 2021-02-16
    • 2011-10-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-09-08
    相关资源
    最近更新 更多