You can either recreate the complete folder structure including the All CRGs folder or you can omit all folders inside the ZIP file by using the -j-flag for the unzip command.

The problem is that the ZIP file was created using the All CRGs folder as top-level like zip "All CRGs.zip" "All CRGs". The correct way would have been zip "All CRGs.zip" "All CRGs/*"which would have created a ZIP archive of all the files and folders inside the All CRGs folder without the surrounding folder.

So the only way to extract only the files by retaining the folder structure would be something like this:

unzip "All CRGs.zip" -d data/ && mv "data/All CRGs/*" "data/" && rmdir "data/All CRGs"

It will unzip the complete folder and after that move the content of the folder up one level and finally remove the (now empty) "All CRGs" folder.

Answer from heiglandreas on Stack Exchange
🌐
3Play Media Support
support.3playmedia.com › hc › en-us › articles › 227729068-Unzipping-Files-Using-Terminal-Mac-Only
Unzipping Files Using Terminal- Mac Only – 3Play Media Support
You can also search for Terminal in your Mac's Launchpad. When you have terminal open, type in the following commands- ... This means to Change Directory to Desktop. ... Terminal will then spit out a few lines of code indicating that your zip ...
Top answer
1 of 5
9

You can either recreate the complete folder structure including the All CRGs folder or you can omit all folders inside the ZIP file by using the -j-flag for the unzip command.

The problem is that the ZIP file was created using the All CRGs folder as top-level like zip "All CRGs.zip" "All CRGs". The correct way would have been zip "All CRGs.zip" "All CRGs/*"which would have created a ZIP archive of all the files and folders inside the All CRGs folder without the surrounding folder.

So the only way to extract only the files by retaining the folder structure would be something like this:

unzip "All CRGs.zip" -d data/ && mv "data/All CRGs/*" "data/" && rmdir "data/All CRGs"

It will unzip the complete folder and after that move the content of the folder up one level and finally remove the (now empty) "All CRGs" folder.

2 of 5
2

Since you know the zip file contains an unwanted top-level folder, and since you know the name of that top level folder, you can use a symlink to cause all the contents of that folder to appear in the parent like so:

ln -s . 'data/All CRGs'
unzip 'All CRGs.zip' -d data

The ln step causes the folder data/All CRGs to be created, linking to the current directory (relative to data/), which is data/. Then, when you extract files from All CRGs.zip and the unzip command tries to create data/All CRGs/file.dat, that file will get created as data/./file.dat.

This technique can be demonstrated without a zip file using touch:

$ mkdir data
$ ln -s . data/subdir     
$ touch data/subdir/foo.txt
$ ls data
foo.txt subdir

You can use this trick too to cause certain files or folders to be extracted to an alternate folder:

ln -s /tmp data/subdir2

Then anything in the archive being extracted to subdir2 will appear in /tmp.

Discussions

macos - Using the unzip command in SSH with Mac Terminal not working - Stack Overflow
I logging into my server from the Mac Terminal Bash Shell and the unzip command is not working I keep getting the following message: bash: unzip: command not found Can I unzip a file via SSH fro... More on stackoverflow.com
🌐 stackoverflow.com
What are all of the command line commands to unzip a file? I need one that preserves extended attributes.
Try this: ditto -xk archive.zip /path/to/destinationdirectory More on reddit.com
🌐 r/macsysadmin
14
2
February 9, 2018
How to unzip multiple parts in same folder with MacOS?
unzip '*.zip' -d combined_folder GO to terminal and navigate to that folder where you have the .zip files - then put that command. It will unzip and place the contents in the "combined_folder" folder. You don't need other software just to do this. Mac has unarchiver built-in. You will not get 3 folders, you'll only have one folder with all of your files. This method solves it. More on reddit.com
🌐 r/MacOS
36
10
May 20, 2024
macos - Unzipping with Terminal Command - Stack Overflow
I need a command for replacing a Foldername in a path in order to unzip alot of Files within the terminal. I'm using this to unzip: find ./ * / -name \*.zip -exec unzip {} \; My Folderstructure is... More on stackoverflow.com
🌐 stackoverflow.com
People also ask

Does Mac have unzip?
Yes, Mac computers have built-in functionality to unzip or extract compressed files. Here are the steps to unzip a file on a Mac: 1. Locate the zip file you want to unzip. 2. Double-click the zip file. This will automatically extract the archive and create a new folder with the same name. 3. If the zip file contains multiple files or folders, you can access them from the newly created folder. Alternatively, you can also unzip a file using the Terminal application. Here's how: 1. Open the Terminal application. You can find it in the Utilities folder within the Applications folder, or you can
🌐
uubyte.com
uubyte.com › home › how to unzip files on mac terminal?
How to Unzip Files on Mac Terminal?
How do I unzip a folder in Mac command line?
Unzipping a folder in the Mac command line is a straightforward process. Here are the steps to unzip a folder using the command line: 1. Open the Terminal application on your Mac. You can find it in the Utilities folder within the Applications folder, or you can use Spotlight search to quickly locate it. 2. Navigate to the directory where the zipped folder is located using the "cd" command. For instance, if the zipped folder is on your desktop, you would enter the following command: ``` cd ~/Desktop ``` 3. Once you are in the appropriate directory, use the "unzip" command followed by the na
🌐
uubyte.com
uubyte.com › home › how to unzip files on mac terminal?
How to Unzip Files on Mac Terminal?
How do I unpack a tar GZ file on a Mac terminal?
To unpack a tar GZ file on a Mac terminal, follow these steps: 1. Open the Terminal application on your Mac. You can find it in the Utilities folder within the Applications folder or use the Spotlight search to locate it quickly. 2. Navigate to the directory where the tar GZ file is located. You can use the "cd" command followed by the directory's full path, or you can use the "cd" command followed by a space and then drag and drop the folder containing the file into the Terminal window. This will automatically fill in the directory path for you. 3. Use the "tar" command combined with the a
🌐
uubyte.com
uubyte.com › home › how to unzip files on mac terminal?
How to Unzip Files on Mac Terminal?
🌐
UUByte
uubyte.com › home › how to unzip files on mac terminal?
How to Unzip Files on Mac Terminal?
April 2, 2024 - Here are the steps to unzip a file on a Mac: ... 2. Double-click the zip file. This will automatically extract the archive and create a new folder with the same name. 3. If the zip file contains multiple files or folders, you can access them from the newly created folder. Alternatively, you can also unzip a file using the Terminal application.
🌐
Swissmacuser
swissmacuser.ch › macos-terminal-bash-unzip-zip-file-with-tar
macOS Terminal: unzip a ZIP file using the tar command in bash – Swiss Mac User 
August 22, 2021 - when in the Recovery Mode of a Mac – but you still need to unzip a ZIP file, you can use the tar command instead! cd /directory/where/zip-file/is/located tar ft zip-file.zip ... The “t” in “xopft” (for tar) or “-v” (for unzip) both enable respective verbose mode – so you’ll see in the Terminal window what is going on during the extraction.
🌐
Windows Report
windowsreport.com › mac › how to unzip files & folders in terminal
How to Unzip Files & Folders on Mac Terminal [Quick & Easy] • MacTips
October 4, 2023 - If you’re not sure how to use the Terminal app on your Mac and want to avoid the possibility of causing any harm to your system, then we recommend that you use the powerful WinZip to unzip your files easily.
Find elsewhere
🌐
SS64
ss64.com › mac › unzip.html
UNZIP Command: Extract compressed files from a ZIP archive in macOS
-M pipe all output through an internal pager similar to the Unix more(1) command. At the end of a screenful of output, unzip pauses with a '--More--' prompt; the next screenful may be viewed by pressing the Enter (Return) key or the space bar. unzip can be terminated by pressing the 'q' key and, on some systems, the Enter/Return key.
🌐
EzyZip
ezyzip.com › home › how to guides › how to unzip files on macos (6 methods)
How to unzip Files on macOS (6 Methods)
July 10, 2023 - For example: unzip /path/to/zipfile.zip -d /path/to/destination · Press Enter: Press Enter to execute the command. The zip file will be extracted to the specified destination folder. Download and install iZip: Download and install iZip from the Mac App Store or the official iZip website.
🌐
Mac Uncle
macuncle.com › home › how to unzip files and folders on mac?
Unzip Files on Mac using Best and Easiest 3 Manual Methods
February 9, 2026 - Type: unzip {name of your zipped file}.zip Last login: Wed Jan 28 13:47:29 on console robertpatricia-MacBook-Pro-2:~ robertpatricia$ cd desktop robertpatricia-MacBook-Pro-2:desktop robertpatricia$ unzip test.zip
🌐
Setapp
setapp.com › how-to › simple-way-to-zip-unzip-files-on-mac
How to zip a folder on Mac and unzip files easily
March 17, 2026 - Terminal is an app that provides text-based access to the macOS operating system in a command-line interface. If you like Terminal and are comfortable with it, you can use commands to unzip files on a Mac.
🌐
Apple Support
support.apple.com › guide › terminal › compress-and-uncompress-file-archives-apdc52250ee-4659-4751-9a3a-8b7988150530 › mac
Compress and uncompress file archives in Terminal on Mac - Apple Support
In Terminal, you can use the GNU tar command to compress and uncompress files and folders. The usual file extension for a compressed tar archive is .tgz, although you might also see files ending with the .tar.gz extension.
🌐
Eltima
mac.eltima.com › file manager for mac › archive utility for mac › how to unzip a file on mac – the easiest way
How to Unzip Files and Folders on Mac
January 17, 2025 - 4. After entering the command, press the Enter key, and the Terminal will initiate the unzipping process, extracting the contents of your .zip file into the current directory. ... Zipped files can be unpacked using the macOS built-in Archive Utility, but it only supports multiple formats and offers quite a few features.
🌐
MacHow2
machow2.com › home › how to › 3 quick ways to unzip files on a mac in 2026
3 Quick Ways To Unzip Files On a Mac in 2026
March 12, 2026 - Terminal is a command-line tool that lets you perform advanced tasks on your Mac. Open Terminal (press Cmd + Space, type Terminal, and press Enter). Type unzip (with a space after the command).
🌐
Wikihow
wikihow.com › computers and electronics › operating systems › mac › how to unzip a .zip file on a mac: beginner's guide
How to Unzip a .Zip File on a Mac: Beginner's Guide
January 3, 2025 - .Zip files are compressed files, so they're quicker to download and easier to access. However, you do have to unzip them to get to the actual information on your computer. There are 3 main ways to do this on a Mac: double clicking, using your terminal, and using an extension.
🌐
Reddit
reddit.com › r/macsysadmin › what are all of the command line commands to unzip a file? i need one that preserves extended attributes.
r/macsysadmin on Reddit: What are all of the command line commands to unzip a file? I need one that preserves extended attributes.
February 9, 2018 -

Opposite of what virtually every fucking Google result says, I actually do need the __MACOSX folder that gets unzipped when using the normal "unzip" command from the terminal. I have some piece of shit software that I have to push out (ABA Secure Browser, if anyone has any hints), that comes prepackaged as a .app bundle in a .zip with lots of hidden extended attributes that totally break the app if they aren't there. Literally, nothing other than downloading, dragging, and dropping the app into Applications will result in a working app.

Google has been no help. Is there a simple command that I can use in a script to uncompress this .zip properly?

🌐
The Mac Observer
macobserver.com › home › tips › how-to › how to unzip files on mac
How To Unzip Files on Mac
September 28, 2025 - Locate the .zip file on your Mac. Right-click the file. From the menu that appears, select “Open” or “Open with”. Choose Open if Archive Utility is the default. Otherwise, select Open with > Archive Utility. The files will decompress into a new folder next to the .zip file. If you want precise control over the extraction process, you can unzip a file using Terminal on a Mac.
🌐
Reddit
reddit.com › r/macos › how to unzip multiple parts in same folder with macos?
How to unzip multiple parts in same folder with MacOS? : r/MacOS
May 20, 2024 - terminal and navigate to that folder where you have the .zip files - then put that command. It will unzip and place the contents in the "combined_folder" folder. You don't need other software just to do this. Mac has · unarchiver built-in. You will not get 3 folders, you'll only have one folder with all of your files.
🌐
Stack Overflow
stackoverflow.com › questions › 71797986 › unzipping-with-terminal-command
macos - Unzipping with Terminal Command - Stack Overflow
I need a command for replacing a Foldername in a path in order to unzip alot of Files within the terminal. I'm using this to unzip: find ./ * / -name \*.zip -exec unzip {} \; My Folderstructure is...
🌐
Magma
magma.maths.usyd.edu.au › magma › faq › extract
Unpacking .tar.gz, .tar, or .zip files
Your operating system may already ... use Windows-style line terminators, you will need to pass the -a option to unzip in order to extract them with UNIX-style line terminators (also needed for Mac OS X)....
🌐
GeeksforGeeks
geeksforgeeks.org › techtips › how-to-zip-unzip-files-and-folders-in-mac
How to Zip and Unzip Files and Folders on MacOS - GeeksforGeeks
July 23, 2025 - After opening the terminal app, type the following commands and press Enter to execute the command as shown below in the image. zip -r <zip file name and directory> <file name and directory that has to be converted into .zip format> Instead ...