如果我运行的是7z a -tzip myDestFile.zip *.txt /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发布于 2015-10-22 22:44:12
这个问题不应该一直悬而未决。对我有用的答案如下:
7za a -tzip test.zip ./*.txt ./*.xlsx
https://stackoverflow.com/questions/28636349
复制相似问题