How can I view the files in a zip archive without decompressing it ?

link|improve this question

25% accept rate
feedback

3 Answers

up vote 5 down vote accepted

The less utility is capable of peeking into a zip archive. In fact, if you look at the outputs of unzip -l zipfile and less zipfile, you will find them to be identical.

link|improve this answer
feedback

Try unzip -l your_zip_file.zip | less

Also, See man unzip for more options

link|improve this answer
feedback

You can make the zip appear as a directory (in which you use cd, ls, etc.) by mounting it with the fuse-zip virtual filesystem.

mkdir foo.d
fuse-zip foo.zip foo.d
ls foo.d
cat foo.d/README
...
fusermount -u foo.d
rmdir foo.d

Another relevant FUSE filesystem is AVFS. It creates a view of your entire directory hierarchy where all archives have an associated directory (same name with # tacked on at the end) that appears to hold the archive content.

mountavfs
ls ~/.avfs/$PWD/foo.zip\#
cat ~/.avfs/$PWD/foo.zip\#/README
...
umountavfs

Many modern file managers (e.g. Nautilus, Dolphin) show archive contents transparently.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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