Unzip a specific subfolder in an archive with the 7-Zip command line version

7-zipconsole

I want to unzip an ZIP archive, but just a subfolder in it.

Example structure archive.zip:

-rootfolder
--subfolder
---subsubfolder

I just want to unzip subsubfolder with 7-Zip (preferably). How can I do it?

Best Answer

To unzip only the "doc" directory inside the ZIP file to "/tmp" directory, you need to specify the absolute path of "doc" directory inside ZIP file:

[bash]$ unzip test.zip "test/doc/*" -d /tmp/