Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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!

share|improve this question
    
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? – pjc50 Apr 18 '12 at 13:32
    
Ah, it should be 7z u my.zip ./ - that solved the problem. Do you want to add an answer, so I can accept it? – Force Apr 18 '12 at 13:37
up vote 4 down vote accepted

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|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .