How to archive merger vs shell loops over many archives
- Step 1Decide on privacy needs first — If the archives contain anything you would not paste into a server log, the browser tool's no-upload model is the deciding factor — extraction and re-zipping happen locally. A shell loop is also local, but on shared CI runners the extracted scratch files persist on disk.
- Step 2Check the format mix — All ZIP? Either tool is fine. A mix of ZIP + 7z + RAR + ISO? The merger reads all of them through one drop zone; a shell loop would need
unzip,7zandunrarwired up per extension. - Step 3Decide how collisions must behave — If two archives sharing a path must both survive, use the merger (it renames later duplicates). If you genuinely want last-write-wins, a
unzip -oloop does that — the merger never overwrites. - Step 4Run the merge in the browser — Drop two or more archives onto the Archive Merger. It extracts each (fflate for ZIP/TAR/GZ, libarchive WASM for 7z/RAR/bz2/xz/ISO), flattens, renames collisions, and produces one ZIP.
- Step 5Or script it for CI — If the merge must run unattended in a pipeline, the browser tool has no API or headless mode for end users — use a shell loop or a build step. Reserve the merger for interactive, ad-hoc, privacy-sensitive merges.
- Step 6Verify the output — Open
merged-N-archives.zipand confirm the Collisions chip matches what you expected. With a shell loop, diff the file count against the sum of inputs to catch silent overwrites.
Archive Merger vs a shell loop (unzip + zip)
A typical merge loop is for f in *.zip; do unzip -o "$f" -d out/; done; zip -r merged.zip out/. Behaviours below reflect default flags.
| Dimension | JAD Archive Merger | Shell loop (unzip + zip) |
|---|---|---|
| Collision behaviour | First writer keeps path; later duplicates renamed to <stem>/<path>; nothing lost | unzip -o overwrites silently — second copy clobbers the first |
| Input formats | ZIP, TAR, GZ, 7z, RAR, bz2, xz, tar.bz2, tar.xz, ISO via fflate + libarchive WASM | ZIP only with unzip; needs tar/7z/unrar added per format |
| Output format | ZIP only (merged-N-archives.zip, fflate level 6) | Whatever you zip/tar it into — your choice |
| Upload / privacy | Nothing leaves the browser; no temp files on disk | Local, but extracted scratch files persist until cleaned |
| Automation / CI | Interactive only — no end-user API or headless mode | Scriptable, schedulable, pipeline-friendly |
| Setup | None — module loads on demand | Requires unzip, plus 7z/unrar/tar for non-ZIP |
When to use which
Pick by the constraint that matters most for the job in front of you.
| Situation | Reach for | Why |
|---|---|---|
| Ad-hoc merge of mixed-format archives | Archive Merger | One drop zone reads ZIP/7z/RAR/ISO without installing anything |
| Confidential bundles that must not be uploaded | Archive Merger | All processing is in-browser; no server path exists |
| Colliding paths must all survive | Archive Merger | Auto-renames later duplicates instead of overwriting |
| Unattended merge inside CI/CD | Shell loop | The browser tool has no headless/API mode for users |
| Need non-ZIP output (tar.gz, 7z) | Shell loop, or Merger + converter | Merger writes ZIP only; convert afterward if needed |
| Last-write-wins is the desired behaviour | Shell loop (unzip -o) | Merger never overwrites — it renames |
Cookbook
Concrete merges shown both ways, so you can see exactly where the browser tool and a shell loop diverge — especially on collisions.
Colliding README: overwrite vs rename
Two ZIPs both have a root README.md. The shell loop's -o flag overwrites; the merger keeps both.
Shell loop (unzip -o): for f in *.zip; do unzip -o "$f" -d out/; done -> out/README.md is whichever archive ran LAST (first one lost) Archive Merger: README.md (from first archive) release-2/README.md (renamed; collision counted) Both survive; Collisions chip: 1
Mixed formats with no extra installs
A ZIP, a 7z and a RAR. The shell loop needs three tools; the merger needs none.
Shell loop: unzip a.zip -d out/ 7z x b.7z -oout/ # requires p7zip unrar x c.rar out/ # requires unrar zip -r merged.zip out/ Archive Merger: drop a.zip + b.7z + c.rar -> merged-3-archives.zip (7z/RAR read via libarchive WASM, no install)
Output format constraint
If the destination requires tar.gz, the shell loop wins directly; the merger needs a second step.
Shell loop: ... ; tar czf merged.tar.gz out/ Archive Merger: merge -> merged-N-archives.zip then Archive Format Converter -> merged-N-archives.tar.gz (/archive-tools/archive-format-converter)
CI pipeline merge
Unattended automation is where the shell loop is the right answer — the browser tool is interactive only.
# CI step (works headless): for f in artifacts/*.zip; do unzip -o "$f" -d combined/; done zip -r release.zip combined/ # Archive Merger: no API/headless mode for end users # -> use only for interactive, on-demand merges
Counting files to detect silent loss
How to verify a shell loop didn't lose files to overwrite — something the merger reports for you via the Collisions chip.
Shell loop check: unzip -l a.zip | tail -1 # N1 files unzip -l b.zip | tail -1 # N2 files unzip -l merged.zip | tail -1 # if < N1+N2, files were overwritten Archive Merger: Collisions chip tells you up front how many were renamed (none lost)
Edge cases and what actually happens
Shell loop overwrites a collision
Data loss riskunzip -o silently replaces an existing file with the same path. Across many archives you can lose files without any warning. The merger renames later duplicates instead, so this class of loss cannot happen.
Non-ZIP input in a ZIP-only loop
Skipped / errorsA bare unzip loop will fail or skip .7z/.rar/.tar.xz inputs. The merger detects each by magic bytes and routes to the right engine.
Merger asked to output 7z
Not supportedThe merger writes ZIP only. If you need a 7z or tar.gz result, a shell loop gives it directly, or convert the merged ZIP with the format converter.
Merge needed inside CI
Use CLIThe browser merger has no end-user API or headless mode. Automated, scheduled merges belong in a shell step or build script.
Encrypted ZIP entry in an input
Fails to readThe merger forwards no password, so password-protected entries can't be extracted and the merge errors. A shell loop can pass -P to unzip for that case.
Very large archive over tier cap
RejectedThe merger enforces per-file size (50 MB Free / 500 MB Pro / 2 GB Pro-media+Developer) and per-archive entry caps. A shell loop has only the machine's RAM and disk as limits.
Both copies of a collision must survive
Use MergerNot a failure — this is the merger's reason to exist. It keeps the first and renames the rest; a default shell loop cannot do this without extra scripting.
Reproducible byte-identical output needed
CLI advantageThe merger always re-compresses at fflate level 6, so output bytes depend on fflate. A shell pipeline lets you pin tar/zip versions and flags for stricter reproducibility.
Frequently asked questions
Is the browser merger faster than a shell loop?
For a handful of small-to-medium archives, the difference is negligible — both extract and re-compress. The shell loop wins at very large scale where it can stream to disk; the merger holds data in memory and is bound by your tier's size/entry caps.
Why would I not just use unzip in a loop?
Three reasons: unzip -o overwrites collisions silently (the merger never does), a bare loop handles ZIP only (the merger reads 7z/RAR/ISO too), and the merger needs nothing installed.
Can the merger overwrite on collision like unzip -o?
No — that behaviour is not available. The merger keeps the first occurrence and renames later duplicates to <stem>/<path>. If you specifically need last-write-wins, a shell loop is the right tool.
Does the merger handle tar.gz like tar -xzf does?
Not member-by-member. A .gz/.tar.gz is detected by gzip magic and gunzipped as a single stream, so you may get one inner file rather than expanded tar members. tar -xzf expands members; to match that, extract the tarball first then merge.
Can I run the merger from a script or CI?
No. There is no end-user API or headless mode for archive tools — they run interactively in the browser. For automation, use a shell loop or build step.
What output format does each produce?
The merger always writes ZIP (merged-N-archives.zip, fflate level 6). A shell pipeline writes whatever you choose — ZIP, tar.gz, 7z.
Do I need p7zip or unrar for the merger?
No. 7z and RAR are read by a bundled libarchive WASM module that loads on demand. A shell loop, by contrast, needs those binaries installed.
Is anything uploaded when I use the browser merger?
No. All extraction and re-zipping happen in your browser tab; there is no server-side path for archive tools.
Which tool preserves folder structure better?
Both preserve folders. The merger keeps each input's internal paths unless they collide, then prefixes the duplicate with the archive stem. A shell loop preserves paths too, but overwrites collisions by default.
How do I know if a shell loop lost files?
Compare the merged file count against the summed input counts (unzip -l). If it's lower, overwrites happened. The merger surfaces this proactively as a Collisions count.
Can I tune compression with the merger?
No — it is fixed at fflate level 6 with no UI to change it. A shell loop lets you pass -1..-9 to zip or use xz/zstd.
When is the merger clearly the better choice?
Ad-hoc, interactive merges of mixed-format archives where privacy matters and colliding paths must all survive — exactly the case where a default shell loop would silently overwrite and need extra tooling.
Privacy first
Every JAD Archive tool runs entirely in your browser using fflate, @zip.js/zip.js, and the libarchive WASM bridge. Your archives never leave your device — verified by zero outbound network requests during processing.