How to update one file in a zip archive

后端 未结 10 1217
心在旅途
心在旅途 2020-12-02 16:16

Is it possible to replace a file in a zip file without unzipping deleting the old file adding the new file and rezipping it back?

Reason is I have a zip file which i

10条回答
  •  隐瞒了意图╮
    2020-12-02 16:57

    There is also the -f option that will freshen the zip file. It can be used to update ALL files which have been updated since the zip was generated (assuming they are in the same place within the tree structure within the zip file).

    If your file is named /myfiles/myzip.zip all you have to do is

    zip -f /myfiles/myzip.zip
    

提交回复
热议问题