Extract one file from a ZIP on a Mac without unzipping everything
Double-clicking a ZIP makes Archive Utility expand everything in it. For a large archive when you need one file, that’s slow and takes up space. Two free ways to take out just what you need:
1. Terminal: unzip
List the contents, then name the file you want:
unzip -l Archive.zip
unzip Archive.zip "Folder/report.pdf"The file is created at that same path (Folder/report.pdf) in the current
folder. Add -d ~/Desktop to put it somewhere else. Quote the path if it has
spaces.
The same idea works for other formats:
- tar:
tar -xf archive.tar.gz path/inside/file.txt - RAR (not password-protected): macOS’s
tarreads these too:tar -xf archive.rar path/inside/file.txt - 7z or any RAR:
7zz x archive.7z path/inside/file.txt(brew install sevenzipwith Homebrew)
2. Purrchiver: look, then drag it out
- Open the archive in Purrchiver: ZIP, RAR, 7z, tar, and more, free.
- Find the file. Press Space to preview it without extracting.
- Drag it to the Desktop or any Finder window, or select several files and extract just those.
Nothing else is unpacked. This also works for password-protected archives, after you enter the password.
Changing one file inside a ZIP
To replace or remove a file without unpacking the whole archive, see How to edit a ZIP file on a Mac without extracting it.