How to move a file in to zip uncompressed, with zip cmd tool

寵の児 提交于 2020-01-02 06:51:08

问题


I'm try to determine how to use the zip cmd line tool to move a file (uncompressed) in to a zip of compressed files (ie I want a zip in the end with all files but one compressed, b/c the one file is another compressed file).

Anyone know how to do this?


回答1:


It looks like you could use -n option to just store the files with defined extensions together with -g option to append the file to archive.

I didn't test it, but something like this should do the trick:

zip -gn .foo archive.zip myAddedFile.foo

Although documentation states that, by default, zip does not compress files with extensions in the list .Z:.zip:.zoo:.arc:.lzh:.arj, so if you are adding a file with one of those extensions you should be fine.

Documentation to the command is here




回答2:


-m is what I wanted, moves the file(s) into a zip.



来源:https://stackoverflow.com/questions/3730747/how-to-move-a-file-in-to-zip-uncompressed-with-zip-cmd-tool

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