Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

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

marked as duplicate by DavidPostill, fixer1234, mdpc, Stefan Seidel, Matthew Williams Jan 28 '15 at 10:56

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

What .zip file? – Oliver Salzburg Aug 17 '12 at 11:16

unzip -l 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 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
At least in Ubuntu, less is somehow configured to do this by default - so less actually shows the list of files. – aviv Mar 24 '13 at 20:30
bzcat for viewing the contents of bz2 files without having to uncompress them first... – Justin E Nov 12 '14 at 19:37
unzip -c also shows the file name and some extra messages (sending them to stdout). Using -p instead only sends the file in binary format. That's more useful for piping – Juan Calero Mar 24 '15 at 10:02

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

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

Start Emacs in command-line and open your zip files with Zip-Archive mode. Without any Emacs/elisp tuning (new users generally fear about), you will see file details like from zipinfo: modes, length, date, time

Then, you will be able to open files in buffers and even save your changes back to archive, with standard shortcuts:

  • Enter on a file name in list to open it
  • Edit and save with Ctrl-x Ctrl-s
  • Kill buffer Ctrl-k to go back to archive buffer and go on

When in Zip-Archive buffer, use Ctrl-h m to get all shortcuts available in Help View.

Hope this may lead you to discover Emacs awesome features

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

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