Arthur’s notes on research

Listing Files in an Archive Without Decompressing

The problem

My Macbook Pro has a fairly small hardrive, so I try to compress files that I do not need on an everyday basis. Mac OS X tends to decompress any archive file that you click on and I needed to check the content of an archive that resided on Dropbox.

The solution

The archive I was looking at was a tar.gz archive. It turns out tar does this very well, which I found out through this blog :

1
tar -tf nameofthearchive.tar.gz

or without the dash (BSD-style options) :

1
tar tf nameofthearchive.tar.gz

If the archive is a zipfile, one can use the zipinfo command :

1
zipinfo nameofthearchive.zip

or unzip -l :

1
unzip -l nameofthearchive.zip