How to update one file in a zip archive

后端 未结 10 1214
心在旅途
心在旅途 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:50

    From zip(1):

    When given the name of an existing zip archive, zip will replace identically named entries in the zip archive or add entries for new names.

    So just use the zip command as you normally would to create a new .zip file containing only that one file, except the .zip filename you specify will be the existing archive.

提交回复
热议问题