Extract Zip Mac Terminal

OPTION 1 – If the Zip File is in the same directory/folder in which your terminal is and we want to extract it in the present working directory. Use the following command to achieve the above described scenario. Sudo unzip zipfilename.zip if the zip file is protected with some password, then use the following command. Follow these steps to open zip files on Mac: Click the Unzip button. From the drop down menu, choose to unzip your files to this Mac, iCloud Drive, Dropbox or Google Drive. A 'Finder style' window will open.

  1. Mac Terminal Extract Zip
  2. Mac Terminal Unzip

Since macOS is based on Unix there are a number of ways to compress files and folders within the filing system using Unix based application code, below are a few options using the Terminal or command line interface (cli). The default command line application interface in macOS is the Terminal and is stored in /Applications/Utilities.

File and folder compression saves on file size and ensures the contents are captured and delivered or stored as one monolithic file. A compressed file which contains files and folders is generally referred to as an archive. Here are some built-in compression applications you can use including zip, tar, gz, bz2, gz and dmg.

ZIP – Cross Platform

First up is ZIP one of the most commonly used compression techniques used across all platforms

To compress

To extract

If you want to make a zip without those invisible Mac resource files such as “_MACOSX” or “._Filename” and .ds store files, use the “-X” option in the command so:

TAR.GZ – Cross Platform

Second up is TAR, an old favorite on Unix/Linux – you add the GZ for the compression – compresses tighter than zip

To compress

To extract

TAR.BZ2 – Cross Platform

A variation on TAR GZ but with better compression than both tar.gz and zip.

To compress

To extract

GZ

Without the tar

To extract

DMG – macOS Only

This one is macOSnative only – for a GUI interface use /Applications/Utilities/Disk Utility – for command line use:

To create

To mount

To view

To Eject

You can also use a number of different formats for creating a .dmg

  • UDZO – Compressed image (default)
  • UDRO – Read-only image
  • UDBZ – Better compressed image
  • UDRW – Read/Write image
  • UDTO – DVD disk image

That’s the low down, the more common compression packages available will typically be covered in one of the above.

Have you received the file and you do not know how to open it? A ZIP file which bears.zip extension is kind of file format that contains compressed folders of files. Zipping files is vital if you are dealing with large or different files that are related to each other and you want to send them online or even transfer the via external drives. In this article, we will focus on how to open ZIP files on Mac and how to unlock ZIP password.

Part 1: Ways of Opening ZIP Files on Mac

1. Open ZIP Files on Mac

Put in mind that, with this method, you will not be able to unzip password protected files. Here are steps on how to open ZIP files on Mac.

Step 1. Use the Finder to locate the ZIP file on your Mac.

Step 2. Next, you have to double click on the ZIP file to extract the ZIP file

Step 3. Once you unzip the file, you will see Archive.zip files within the ZIP folder.

Step 4. After that, right click on the theArchive.Zip folder and open it inbuilt Archive utility on Mac.

And that is it.

2. Open Zip Archives in Mac OS with The Unarchiver

Alternatively, you can use open ZIP files on Mac by using a third-party ZIP archiver tool. You can a tool like Unarchiver for Mac and below is a guide on how to open ZIP files with Unarchiver.

Step 1. First, you will need to download Unarchiver for Mac from the Mac Apple Store.

Step 2. Next, you can then open the Unarchiver application and associate it with the Archive files and any other files you might need to use with in future.

Step 3. Next, you have to locate the Archive.Zip files on your Mac using the finder.

Terminal

Step 4. Once you find it, then double click on it and select 'Open With' and choose 'Unarchiver' option.

Step 4. You can then give a name to the folder file that to be extracted and the program will extract the ZIP files immediately. Also, it is important to note that, at this point is when you can enter the password to unlock zip password files.

There you go, you now have all the archived files on your Mac.

Mac Terminal Extract Zip

Part 2: Extract Zip Files with Terminal

Mac platform also allows you to open ZIP files in Terminal. I know you look surprised but is quite simple. Just follow the steps below.

Step 1. First, open the Terminal on your Mac computer.

Step 2. Next, type 'unzip' and add a space. Now, drag and drop the zip file into the Terminal window. Alternatively, you can use the command at a zip archive to extract it to the present working directory.

Step 3. After that, hit 'Enter' and the terminal will unzip files and store them on the local folder of your computer.

Part 3: View the Contents of a ZIP File without Extracting the Archive

Yes, you can view the content of a ZIP file without having extracting it to archive. Assuming you have ZIP files that have named almost the same and you are wondering which could be the correct ZIP file that you want to extract.

In some cases, you might want to preview the content of the ZIP files that you have been sent without having unzipped them at that moment. Therefore, you will have to look for a way to preview them. A proven method that allows you to view ZIP info is using the Terminal on your Mac.

Way 1: Checking ZIP Archive Contents with ZIP Info

The first way that you can view ZIP Archive info is by using zip info command. With the Zip info command, you will be able to view the file size of each item within the archive, size of the zip, the number of files, total the read/write/execution permissions per folder, modification date of the file and time, the compression level, as well as the file names.

However, a disadvantage of the ZIP info command is that it does not allow you to view info of locked zip files with passwords.

With that being said, the command of Zip info that you need to execute on the terminal is as follows:

And when you execute the zip info command it will display something similar to the image below:

Way 2. Viewing Zip Contents with unzip

The second method that you can use to view the contents of Zip files is by using the ZIP command in the Terminal. Unlike the ZIP info command that does not require a flag, this command requires flag and its content is not that detailed as the ZIP info. However, when you execute this command, you will still be able to view the file size, modification date and time of the file, the total number of files in the ZIP files and file names.

On the contrary, Unzip -1 command has its advantage over the ZIP info. The Unzip command is available across all OS platforms, unlike the ZIP info that is available in some OS.

With further ado, let us have a look at the structure of unzip command that you need to execute on the terminal.

And when you run this command, this what you will expect to see on your screen. This output below is just a sample, and the content will vary with your ZIP archive.

Summary

Mac Terminal Unzip

When it comes to handling ZIP files on Mac, it should no longer be a problem on how to open them or view its content. As stated earlier, to open ZIP files Mac you can use it inbuilt Archive utility or download a third-party tool such Unarchiver. The beauty with Unarchiver is that you will be able to unlock ZIP password easily. Moreover, if you want to view the content of ZIP files without having to archive them, you can use ZIP info command or Unzip command. I hope you can handle ZIP files with ease. And if the Windows users, you can also read How to Open Password Protected ZIP Files without Password to find your solutions.