Skip to content

Instantly share code, notes, and snippets.

@ben-xd
Created April 3, 2026 22:42
Show Gist options
  • Select an option

  • Save ben-xd/28b085c6caff3154c5392ff1d7400150 to your computer and use it in GitHub Desktop.

Select an option

Save ben-xd/28b085c6caff3154c5392ff1d7400150 to your computer and use it in GitHub Desktop.

Extract All ZIP Files into a Single Folder Using Terminal on macOS

Follow these steps to extract multiple ZIP files into one folder without creating subfolders: Steps to Extract All ZIP Files into One Folder:

  1. Place All ZIP Files in One Folder

Ensure that all the ZIP files you want to extract are in a single folder. 2. Open Terminal

Press Command + Space to open Spotlight.

Type Terminal and press Enter.
  1. Navigate to the Folder

Use the cd command to navigate to the folder containing your ZIP files. For example:

cd /path/to/your/folder

Replace /path/to/your/folder with the actual path to your folder. You can also drag and drop the folder into Terminal after typing cd to automatically insert the path. 4.Create a Single Target Folder

Create a new folder where all extracted contents will be placed:

mkdir extracted_files

  1. Extract All ZIP Files into the Target Folder

Run the following command to extract all ZIP files into the extracted_files folder:

for zip in *.zip; do unzip -d extracted_files "$zip"; done

*.zip targets all ZIP files in the folder.

-d extracted_files specifies that all files will be extracted into the extracted_files directory.
  1. Access the Extracted Files

Once the process is complete, all files from the ZIP archives will be in the extracted_files folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment