Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can I see the contents of a particular file in an archive without extracting the .zip it is contained within? I'm using the Linux command line.

share|improve this question
    
What .zip file? –  Oliver Salzburg Aug 17 '12 at 11:16
    

4 Answers 4

unzip -l archive.zip lists the contents of a ZIP archive to ensure your file is inside.

Use the -c option to write the contents of named files to stdout (screen) without having to uncompress the entire archive.

unzip -c archive.zip file1.txt file2.txt | less

For this kind of operation I always pipe the output to less, otherwise the whole file goes flying up the screen before you can read it.

BTW zcat is great for viewing the contents of .gz files without having to uncompress them first.

share|improve this answer
    
thanks for the neat zcat tip! –  invert Aug 17 '12 at 12:11
2  
At least in Ubuntu, less is somehow configured to do this by default - so less archive.zip actually shows the list of files. –  aviv Mar 24 '13 at 20:30

If you're just looking to view images inside the archives, you can use Comix or newer MComix to see images inside .zip, .cbr, and .cbz files without extracting.

share|improve this answer

If the file is included in zip archive, that you need to extract only that file from archive (may depend on archive type, some archives can't extract files seperately)

share|improve this answer

zipinfo is another tool you might use, this is useful if you're on a locked-down system where unzip is not allowed.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.