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 view the files in a zip archive without decompressing it ?

share|improve this question
add comment

5 Answers

up vote 57 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.

share|improve this answer
5  
Note, that less zipfile on MacOS-X displays the binary filecontent, so you see a lot of garbage instead of the content of the zip-file. Then you should opt for the ``ùnzip -l zipfile``` –  heiglandreas Jan 25 '13 at 9:59
    
I get slightly more information from unzip compared to less. Just saying. –  matt burns May 7 '13 at 10:57
    
Equally in Ubuntu (at least in version 12.10) less zipfile displays the binary filecontent as @heiglandreas said. –  user12287 2 days ago
add comment

Try unzip -l your_zip_file.zip | less

Also, See man unzip for more options

share|improve this answer
    
You can skip the pipe to less command. It is great idea in a big collection of files, though. –  user12287 Jul 9 at 14:39
add comment

Please use

vim ZIP_FILE_NAME

for the same. This is a simple and easy to remember one.

share|improve this answer
add comment

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.

share|improve this answer
add comment

Its actually unzip -l file.zip | grep "search" or if you have a lot of files

for i in `ls *zip`; do 
  unzip -l $i | grep "search"; 
done

Update: Changed from '-p' to '-l' in order to search for files.

share|improve this answer
add comment

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.