Skip to main content
coreydaley.dev

How to edit a ZIP file on a Mac without extracting it

Finder can’t change what’s inside a ZIP. Double-click one and Archive Utility extracts the whole thing, and the usual workaround — unzip everything, change one file, compress it all back up — is slow and easy to get wrong. There are two ways to skip it on a Mac: the zip command that comes with macOS, and Purrchiver’s Edit mode.

The free way: zip in Terminal

macOS includes the Info-ZIP zip command, and it can change an existing ZIP without extracting it:

ToRun
See what’s insideunzip -l archive.zip
Add a file, or replace one with the same pathzip archive.zip notes.txt
Remove a filezip -d archive.zip notes.txt
Remove a folder and everything in itzip -d archive.zip "docs/*"

Paths matter. zip stores a file under the path you type, relative to the folder you run it from. To replace docs/readme.txt inside the archive, run the command from a folder that contains docs/readme.txt and type zip archive.zip docs/readme.txt. Run it from inside docs/ instead and you get a second readme.txt at the top of the archive, with the old one still there. Put patterns like "docs/*" in quotes so the shell doesn’t expand them.

zip only works on ZIP files. For 7z, 7-Zip’s command-line 7zz can add, update, delete, and rename entries; see Purrchiver vs 7-Zip.

The Mac app way: Purrchiver’s Edit mode

Open the ZIP in Purrchiver and you see its contents, read-only. Press ⌘E (or click the pencil in the toolbar) to switch to Edit mode, then:

  • Add files by dragging them from Finder into the archive’s pane.
  • Remove files with the − button on a row, or select several and click the − in the pane header.
  • Rename a file or folder with Return, or make a new folder with ⇧⌘N New in 1.1.
  • Save with ⌘S, back over the original or as a copy somewhere else.

Browsing an archive is free. Editing it is part of the one-time $9.99 unlock, which Purrchiver offers the moment you make your first change. Edit mode works on ZIP (including AES-256 encrypted ZIPs), 7z, Apple Archive, Apple Encrypted Archive, CPIO, and ISO. RAR and the tar family are read-only; the editing help page has the full list. Before 1.1, Purrchiver doesn’t rename entries in place.

In Purrchiver 1.1 you can also double-click a file in the archive to open it in its app New in 1.1; if you change it there and save, Purrchiver offers to put the changed file back into the archive.

Editing an encrypted archive: Purrchiver asks for the password when you start. When you save, it never writes the result out unencrypted: ⌘S opens the save options already set to the same format and encryption, with that password filled in. Change it there if you want a new one.

Why editing is a separate mode

Editing arrived in Purrchiver on May 23. Archives open in Browse mode, and you switch to Edit mode on purpose, the same way Preview makes you choose markup before it lets you draw on a PDF.

That’s deliberate. Mac users drag files around constantly, and an archive that silently changed because something was dropped on its window would be a nasty surprise.

Not unpacking the whole thing

The point of editing in place is not touching what you aren’t changing. When you save, Purrchiver copies each entry you kept straight across from the original archive into the new one, without extracting anything to disk. You need free space for the new archive, not for an extracted copy of everything in it. The new archive is written to a temporary file and only then swapped into place, so a failed save leaves your original untouched.

Modification dates and permissions come through unchanged.

Converting while you save

Because saving rebuilds the archive, you can also pick a different format on the way out. Open a ZIP, choose 7z when you save, and you’ve converted it without extracting a file. Saving to ZIP, tar, gzip, bzip2, or Apple Archive is free; 7z and the other advanced formats need the unlock.