how to zip in mac

How to Zip on Mac using Terminal

One of the built-in features on macOS is the Terminal, which provides a command-line interface to perform various tasks. You can use the Terminal to zip files and folders on your Mac using simple commands. Here’s how you can do it:

Step 1: Open Terminal

To open the Terminal on your Mac, follow these steps:
1. Press Command + Spacebar to open Spotlight Search.
2. Type “Terminal” and press Enter to launch the Terminal application.

Step 2: Navigate to the desired directory

Once the Terminal is open, navigate to the directory where the file or folder you want to zip is located. Use the cd (Change Directory) command followed by the path of the directory you want to go to. For example, if your files are located in the “Documents” folder, use the following command:
cd ~/Documents

Step 3: Zip a file or folder

To zip a single file, use the zip command followed by the name you want to give to the zipped file and the path to the file you want to zip. For example, to zip a file named “example.txt” in the current directory, use the following command:
zip example.zip example.txt
To zip multiple files or folders, separate their names with a space. For example:
zip example.zip file1.txt folder1

Step 4: Verify the zipped file

Once the zipping process is complete, you can verify the zipped file by listing its contents. Use the unzip -l command followed by the zipped file’s name. For example, to list the contents of “example.zip”, use the following command:
unzip -l example.zip

Conclusion

Zipping files and folders on Mac using the Terminal is a simple process. By following the steps outlined above, you can quickly create compressed archives of your desired files or folders.