问题
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