Blog by an Apple Certified Tech

View zipped files without expanding

Don’t know how useful this command would be for an end user but yes, if you are good at Terminal, you would love to use this.

So lets start, launch the Terminal. Navigate to the zip file you want to have a glance at, by using the “cd” command and type the path to your file. For example cd ./downloads, this file can be any any where on your Mac. downloads can be replaced by the folder on your Machine.

Here comes the magic bit, copy and past the following into Terminal.

unzip -l "$@" MyFile.zip

Where text.zip is the name of you zip file you want to view. You need to have the at and dollar symbol for the text to be displayed on screen. You should have something similar to the image shown below.

Very handy where you can see the size of the file in bytes, the date is was created and the name and location of the file.

You can send the information found in the screen shot to a text file. You can use this to keep a log of a text file or as a backup to send to someone else. To forward the information to a text file type the following:

unzip -l "$@" MyFile.zip > textfile.txt

You can append the data to the end of a text file by using to arrows “>>”. This will add what ever is found in the zip file to the end of the text file you select, great if you are making an archive of what is in text files.

There is nothing much to do except writing few line and you can check if the file is exactly you are looking for.

0 Comments: