I know this is old question, but I wanted to do the same. Update a file in zip archive. And none of the above answers really helped me.
Here is what I did. Created temp directory abc
. Copied file.zip
to abc
and extracted the file in that directory. I edited the file I wanted to edit.
Then while being in abc
, ran the following command
user@host ~/temp/abc $ zip -u file.zip
updating: content/js/ (stored 0%)
updating: content/js/moduleConfig.js (deflated 69%)
-u
switch will look for changed/new files and will add to the zip archive.