Home » Questions » Computers [ Ask a new question ]

Specifying a destination path while creating a zip

Specifying a destination path while creating a zip

Let us assume I have a zip file called patch.zip, when I run unzip -l patch.zip I get the following output.

Asked by: Guest | Views: 60
Total answers/comments: 1
Guest [Entry]

"I don't think there's a way to specify the pathname files should have within the zip-file, so you can't say ""store /var/tmp/Readme.txt"" as doc/Readme.txt"".

You would have to create the directory layout on disk first, as a sort of staging area:

mkdir doc
cp -p /path/to/Readme.txt doc
zip foo.zip doc/Readme.txt"