Read specific file from a zip archive without extracting

Hi All,

I would like to extract specific file from a zip archive.

I have a zip archive "sample.zip".

sample.zip contains few text files and images... text1.txt, text2.txt, pic.jpg etc...

I need to read specific file "text2.txt" from "sample.zip" WITHOUT EXTRACTING the zip file.

Please Suggest.

Hi,

I think it is not possible to read a specific file from a zip file without unzipping it.
Comments are welcome!!!!

Hey guys,

We can read the specified file from an archive without extracting. I used the below code.

 
unzip -p test.zip "text.txt"

when u use unzip cmd its getting extracted right??

No. It will not get extracted when using "unzip -p" option.

It'll fetch the contents alone without extracting. I tried it.