Zip In Mac Terminal

Where is mac terminal

Not many people know that it is possible to use the terminal of our macOS to zip files and folders. This little trick can be useful to many developers or geeks who like to use the terminal frequently or if you just want to learn new tips.

Hold Command and Press Space to open Spotlight, type Terminal to search and Enter. Opening Terminal through Spotlight. Now try the unzip command for your zip file. Unzip (You can drag and drop the zip file, so it can paste the directory too) Press Enter and it will start unzipping. Decompressing the zip file in Terminal. It’s easy to create tar on Mac or untar such as an archive using software or in Terminal. If you often need to zip or unzip files, then it’s a good idea to use professional software like Cisdem Unarchiver. Of course, you can also choose to tar files by using command line. Unzipping Files Using Terminal- Mac Only. Terminal is an application that provides provides text-based access to the operating system, in contrast to the mostly graphical nature of the user experience of OS X, by providing a command lined interface to the operating system. It is located in the Utilities folder within the Applications folder. To compress multiple files in a zip archive in Linux, you can run the following command in the terminal. Zip filename1 filename2 filename3 Keep in mind that the will be the archive which will have the filename1 and all the files in it.

Using Zip from Terminal

Zip In Mac Terminal

First of all, we should say that we need to use two different commands to compress and extract files. The command to compress files into an archive is zip, but if we want to extract the content of an archive we should use unzip.

If we want to Zip files and folders or UnZip an archive in macOS using the terminal you need to use the following commands:

  • Zip a file:zip file
  • Zip a folder:zip -r folder/
  • Unzip an archive:unzip

Using Ditto from Terminal

The ditto command is a very strong utility tool in macOS. Unlike zip, ditto can perform different operations, including copying files and folders, merging the contents of different folders. ditto is the command that the Finder app uses under the hood.

To Zip files and directories or extract archives in macOS using the ditto command from the terminal, you can use the following commands:

  • Zip a folder:ditto -c -k --sequesterRsrc --keepParent folder
  • Extract an archive:ditto -x -k destination


Zip Mac Terminal Password

In this article we have learned to use three new commands: zip, unzip and ditto (partially). We now know how to zip and unzip files and folders using the macOS terminal, and this will definitely help us to feel better at the end of this day.

In conclusion, if you want to learn more about these commands, here you will find the full documentation:

It’s a common action to zip and unzip files on your Mac at work or for study since emails as well as cloud services can’t save files with large size. This article covers all the information you want to learn how to zip 2 files together, how to unzip files on Mac, how to fix corrupted zip files, and how to recover lost or deleted zip files on Mac with data recovery software (Download the free trial by clicking the button).

Most files are usually large and can be quite inconvenient, especially if you email the file to someone else. Sending such could take a long time to deliver, takes up too much space, and needs to be zipped. You will learn how to zip and unzip files on your Mac in this article.

Part 1. How to Zip Files on Your Mac

When you zip a file, the file gets compressed, and every redundant file enables it to take up a smaller space and be sent and delivered much faster.

On Mac computers, files can either be zipped as a single file or as multiple files. To zip a single file on Mac, all you need to do is right-click the file you intend to zip. From the pop-up menu to appear on the screen, tap on ‘Compress’ to zip the file.

Zip In Mac Terminal

If you want to learn how to zip two files together on a mac, follow these quick and easy steps to zip multiple files on your Mac.

Step 1. Select all the files you need to compress by holding down your mouse and drag through the files to be zipped. If you aren’t using a mouse, you can hold down your trackpad while dragging through to select the files.

Step 2. Once the files have been selected, press ‘Control,’ then select ‘Compress.’ Also, you can right-click on the desired files and tap on ‘Compress.’ Your files will then be compressed to a single file, with the original file staying intact.

Step 3. Once you have successfully zipped your file, you can rename it by clicking on ‘Control,’ then select ‘Rename to change the file name from

Part 2. How to Unzip Files on Mac

When you have a zip file, it is impossible to access the file's contents until the file is unzipped. The process of unzipping files is easy, fast, and stress-free on Mac since the Mac OS has an in-built archive utility that zips and unzips files. This implies that you don’t need third-party software to zip and unzip your file unless the file develops some complications along the way. To learn how to unzip files on mac 2021, follow these simple steps.

Double-click on the zip file you intend to unzip. Next, a pop-up folder will appear on the same spot as the file. Open the file, and your zip file will be automatically unzipped.

Optionally, you can unzip your file on Mac by right-clicking the zipped file and select ‘Open With’ From the list of options to appear, choose Archive Utility. Your file will then be unzipped, and you can now access its contents.

Part 3. How to Open Zip Files on Mac with Terminal

The terminal is an application on the Mac OS which provides text-based access to your computer’s OS. The terminal has a zip command that helps you zip and unzip files on Mac. You can locate the terminal from your computer’s utility folder or search for ‘Terminal’ on your search box. To open zipped files on Mac, follow these simple steps.

Step 1. Move File to Desktop

If you move the zipped file, you intend to open it to your desktop, and it is easier for the file to be located and opened.

Step 2. Open Terminal

Zip In Mac Terminal Online

There are two ways to open the terminal on Mac. You can either locate it from the list of applications in the ‘Utility’ folder, or you can search for the terminal on your computer’s search box. After finding the application, click to open.

Step 3. Change The Directory to Desktop

You can change the terminal’s directory to the desktop using the command prompt. To do this, type ‘cd desktop,’ which means ’change directory to desktop’.

Step 4. Unzip The File

Zip in mac terminal commands

To unzip the file, type ‘unzip (name of the file to be unzipped).zip You will then receive a notification saying your file has been unzipped. Go back to your desktop and access the contents of the file.


Part 4. How to Fix Corrupted Zips Files

Due to the popularity of zip files and their ability to compress multiple files, it is prevalent to come across corrupted zip files. There is no need to worry, though, since it’s possible to fix corrupted zipped files. Some of the common why zipped files get corrupted are as follows:

  • The zipped file is located in the wrong sector of a corrupted hard drive or storage space.
  • There might have been an accidental complication during the creation of the zip file. Such complications include sudden power outages, abrupt system shut down, or any other unexpected interruptions.
  • Incomplete download or transfer.
  • Virus attack targeted at your system.

Zip A Folder In Mac Terminal

If your zipped files have been corrupted due to any reasons listed above, keep reading to learn how to fix such issues.

  • To fix a corrupted zip file located in a corrupted hard drive, you will need a good file repair tool. You can use Winzip Command Prompt for Windows computers or Terminal’s Zip Command for Mac to fix the corrupted zipped files. If these methods fail to fix the problem, you can make use of professional data recovery software.
  • If the zip file got corrupted due to unexpected interruptions, restart the computer and recreate the zip file.
  • To fix a corrupted file due to incomplete download or transfer, you can re-download or re-transfer the corrupted file and try to open it again.
  • The easiest way to fix zip files corrupted by virus attacks is to use professional data recovery software to retrieve and fix the affected zip file.

Zip In Mac Terminal Commands

Part 5. How to Recover Deleted Zips Files on Mac

Accidental deletion of files is a widespread phenomenon for Mac users. If you have accidentally deleted your zip files on Mac, it is straightforward to recover them if you use the iBeesoft Data Recovery software. It is a professional file recovery software that helps you recover deleted or lost Zip and RAR files on Mac and Windows computers. The software is fast, reliable, and user-friendly. To recover deleted files on Mac, follow these simple steps.

Step 1. Download And Install The iBeesoft Archive Recovery tool

You will first have to download and install it on your Mac computer; then, you launch the software. Next, select the particular file type to be recovered or select ‘ All File Type’ and click ‘Start’ to proceed.

Zip In Mac Terminal Download

Step 2. Select a Location

Zip In Mac Terminal Free

After clicking start, you’ll be asked to select a location. Choose the desired location from your computer hardware or external storage and click on ‘Scan’ to begin the archive recovery scanning process.

Step 3. Scan, Preview, and Recover Zipped File

In a short time, all your lost files will be scanned and displayed on the screen. Select the file type you intend to recover (archive in this case) and preview the files. Once you’re satisfied with the results, click on ‘Recover’ to save deleted zip on Mac.