0

I have a file structure as so:

archive.zip contains:
    directory archive which contains:
        zip_1.zip contains:
            file.txt
        zip_2.zip
        zip_3.zip

Is there a way that I can extract file.txt without having to unzip archive.zip? I'm currently extracting zip_1.zip with

unzip -j archive.zip "archive/zip_1.zip" -d "/path/where/zip_1/will/go"

then extracting file.txt out of the resulting zip_1.zip .

Is there a clean way to extract file.txt in this situation?

1
  • due to the nature of zip, seeking the file appears to be mandatory. This precludes one-pass stream handling like with eg .tar.gz (using tar --to-stdout -xzf file.tar.gz innerfile.tar.gz | tar -xzf - ), even if unzip provides options -c and -p to extract to stdout. So beside a specialized program made at least in perl or python to store intermediate data in memory, this doesn't appear to be scriptable without using temporary files.
    – A.B
    Jun 26, 2018 at 18:40

1 Answer 1

0

Here can be your solution using 7zip

1
  • Should have mentioned that I'm unable to use 7zip on the remote server, or else I would have followed that solution. Jun 26, 2018 at 15:59

You must log in to answer this question.

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