How to update one file located in a zip subdirectory?

8,662

The relative path needs to be the same within the zip and with the directory structure on the file system, from the current directory.

Share:
8,662

Related videos on Youtube

Force
Author by

Force

Updated on September 18, 2022

Comments

  • Force
    Force over 1 year

    I have a zip archive that contains several folders and I need to update one specific file within such a folder.

    How can I update the file with a command line? I have already tried

    7z u my.zip ./folder/text.file
    

    But that places the file into the zip's root.

    Also

    zip -u my.zip ./folder/text.file
    

    doesn't seem to do anything.

    Thanks!

    • Wayne Jhukie
      Wayne Jhukie about 12 years
      I think the relative path needs to be the same within the zip and with the directory structure on the file system, from the current directory. Is that the case?
    • Force
      Force about 12 years
      Ah, it should be 7z u my.zip ./ - that solved the problem. Do you want to add an answer, so I can accept it?