List Files That Will Be Unzipped


-l

Sometimes you might find yourself looking at a Zip file and not remembering what's in that file. Or perhaps you want to make sure that a file you need is contained within that Zip file. To list the contents of a zip file without unzipping it, use the -l option (which stands for "list").

$ unzip -l moby.zip Archive:  moby.zip    Length     Date   Time     Name   --------    ----   ----     ----          0  01-26-06 18:40    bible/     207254  01-26-06 18:40    bible/genesis.txt     102519  01-26-06 18:19    bible/job.txt    1236574  01-26-06 18:19    moby-dick.txt     508925  01-26-06 18:19    paradise_lost.txt   --------                   -------     2055272                   5 files 


From these results, you can see that moby.zip contains two filesmoby-dick.txt and paradise_lost.txtand a directory (bible), which itself contains two files, genesis.txt and job.txt. Now you know exactly what will happen when you expand moby.zip. Using the -l command helps prevent inadvertently unzipping a file that spews out 100 files instead of unzipping a directory that contains 100 files. The first leaves you with files strewn pell-mell, while the second is far easier to handle.



Linux Phrasebook
Linux Phrasebook
ISBN: 0672328380
EAN: 2147483647
Year: 2007
Pages: 288

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net