7zip CLI whitelist files to add by extension

孤街醉人 提交于 2020-02-07 19:02:50

问题


If I'm running the 7z a -tzip myDestFile.zip some/dir command and I want to add to it a file extension whitelist, such that if I put *.txt *.xls *.doc, it will only add files with those extensions to the archive, how would I do that? The documentation does well at whitelisting by a single extension, but what about multiple? Am I just going to have to run the command several times in my script?

I've tried the following:

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

回答1:


This Question shouldn't remain open. The answer that worked for me is below:

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



来源:https://stackoverflow.com/questions/28636349/7zip-cli-whitelist-files-to-add-by-extension

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!