CLI reference
Every command, argument, option and default of the arca binary.
Last updated
ZIP, 7z, TAR (plain, gzip, XZ, bzip2 and Zstandard), standalone gzip, XZ, bzip2 and Zstandard, and RAR are enabled by default. RAR supports list,
test and extract, including -p for encrypted data or headers, and
create for new RAR5 archives, solid, encrypted, in volumes or with a recovery record. Modifying an existing RAR or
CBR, and creating CBR, is always rejected.
Fast, safe archiverUsage: arca <COMMAND>Commands: create Create an archive [aliases: c] list List the contents without extracting them [aliases: l] extract Extract the contents [aliases: x] test Check integrity without writing to disk [aliases: t] hash Print or check checksums of files, in the sha256sum format password Add, change or remove the password of an existing archive comment Show or change the comment of an archive or of one entry repair Rebuild a damaged archive from what can still be read diff Compare two archives, or an archive and a folder bench Measure every codec on generated data (--codecs), or the R1 and R2 requirements on an archiveOptions: -h, --help Print help -V, --version Print versionlist, extract and test also read the ZIP containers (.apk, .jar, .epub, .cbz and the rest), ISO 9660 images, CPIO, AR, DEB, RPM, CAB and LZH, disk images (.vhd, .vhdx, .vmdk, .dmg, .img) and, in builds with RAR, .rar and .cbr. Those are read-only: password refuses them and create refuses every one of them except new .rar archives. Any part of a split set, such as backup.zip.002, opens the whole set; split sets are read-only too. A self-extracting program made with create --sfx reads as the ZIP it carries.
create · c
Create an archive. The format is taken from the extension of the output file.
list · l
List the contents without extracting them.
For a .zip, the archive comment and any entry comments go to standard error after the list, so standard output stays one line per entry. So do a RAR archive’s comment and the pax comment records of TAR entries. Control characters in them are shown as � so a comment can’t drive the terminal.
extract · x
Extract the contents.
test · t
Check integrity without writing to disk.
hash
Print a checksum for every file, one line each in the format sha256sum writes (<hex> <path>), or verify a file of such lines. Directories are read recursively, in name order. Files are read in pieces, never whole into memory, and several are hashed at once across the cores; the lines still come out in order.
arca hash photos > SHA256SUMSarca hash --check SHA256SUMS # or: sha256sum -c SHA256SUMSarca hash -a crc32 setup.exePaths are printed as given, with / between folders on every system. A sum file may use * before the name (binary mode), Windows line endings, a byte-order mark and the escaped names sha256sum writes for names holding a backslash or a line break. Lines that aren’t checksums are reported and skipped. A file that can’t be read, a checksum that doesn’t match, or a sum file with no checksum lines at all, gives exit status 1. BLAKE3 isn’t offered: its Rust crate needs a C compiler by default.
diff
Compare two archives, or an archive and a folder, and print one line for each name the two sides hold differently. Either side can be any archive list reads, a RAR volume set named by any of its volumes, or a folder. Entries are read straight out of the archives, never extracted.
arca diff release-1.0.zip release-1.1.ziparca diff backup.tar.zst ~/project # does the backup still match the folder?arca diff --quick -p secret a.7z b.zip- Lines come in name order. Names use
/and folders end in/. They are compared exactly as written, so case matters. A leading./and doubled slashes are ignored, and a backslash reads as/. - A folder is compared by what it holds, not by its own name:
arca diff a.zip outafterarca x a.zip -o outprints nothing. Folders that only appear in the paths of their files count as folders, so an archive without folder entries still matches its extraction. - By default, files of the same size are read on both sides and compared by SHA-256, unless both sides store CRC32s and those differ. A standalone
.gz,.xz,.bz2or.zsthas no reliable size, so it is always read, except with--quick, which never reports it as changed. - Links can only be told apart in TAR and on the disk. A TAR hard link counts as the file it names. Devices and pipes are left out.
- A side that can’t be opened, a wrong or missing password, or an entry that has to be read and can’t be, gives exit status 2 rather than a difference.
password
Rewrite a .zip with a different password, or with none. Entries aren’t compressed again, because WinZip AES encrypts the already-compressed bytes.
7z password changes and archive mutation are unsupported. See Creating archives for the methods, their parameters and filters, and empty-only encryption.
comment
Show or change the comment of an archive, or of one entry.
arca comment notes.zip # print the archive commentarca comment notes.zip --set "Sent on 3 May"arca comment notes.zip --entry docs/a.txt --file note.txtarca comment notes.zip --clear -o copy.zip- With none of
--set,--fileand--clearthe comment is printed, with control characters shown as�. A TAR has no comment of its own, so without--entryit lists the entries that carry a paxcommentrecord. - Only ZIP comments can be changed. The archive is written again beside itself with every entry copied unchanged, so no password is needed even for encrypted entries; it is read back and only then put in place of the old one.
- An
--entrythat matches nothing is an error, and nothing is written.
repair
Rebuild a damaged archive from what can still be read, into a new archive of the same format. The damaged archive is only read.
arca repair broken.zip -o fixed.ziparca repair backup.tar.gz -o rescued.tar.gzThe rebuilt archive is written under a temporary name, read back, and only then renamed. A repair never overwrites anything: if the --out path already exists, even as a link that leads nowhere, nothing is read or written and the command fails, and a file that appears under that name while the repair runs is kept and the repair fails too. If nothing can be recovered, nothing is written and the command fails. Lost entries are listed on standard error with the reason.
ZIP. Arca scans the file for local headers, takes each entry’s sizes from its header or, for streamed entries, from the data descriptor that follows the data, decompresses it and compares its CRC, and copies the entries that pass byte for byte into a new archive.
- Encrypted entries can’t be checked without the password: they are copied after a structural check only and named on standard error.
- What only the central directory held is lost: archive and entry comments, Unix permissions and other external attributes.
- A ZIP stored inside an entry stays inside it. If that outer entry is damaged, though, the inner entries can surface as entries of their own.
- A file that would make the scan read far more than its own size, such as one crafted with a fake header every few bytes, or one with more than ten million local headers, is scanned only that far: what was recovered up to there is kept, and standard error says at which offset the scan stopped and why.
TAR. Every entry whose header checksum holds and whose data is all there is copied with its headers unchanged; the new archive is compressed again with the same codec. After a damaged header, Arca looks at the following 512-byte blocks for the next one that is a valid header and carries on from there.
- TAR keeps no checksum over data, so damage inside an entry’s data goes unnoticed. A block inside some entry’s data that happens to look like a header, such as a TAR stored inside the TAR, is taken for one.
- A hard link whose target was lost is left out.
- Damage inside the gzip, XZ, bzip2 or Zstandard stream stops the repair there: nothing after it can be decoded. What came before it is kept, but those formats check their data after handing it out, so the last entries kept before the damage are unchecked, and Arca says so.
7z. Each solid block is decoded on its own, so damage in one block costs nothing in the others. In a damaged block, the first entry that fails its CRC or doesn’t decode and every entry after it are lost; an entry without a CRC of its own is kept only if its whole block decodes. The survivors are compressed again at the normal level.
- The header at the end of a 7z is what says where every block and entry is: a 7z with a damaged header can’t be repaired.
- Folders alone are not a repair: when every file is lost, nothing is written and the command fails, even if the folders survive.
RAR. Rebuilds the archive from its recovery record, which it must have been made with (WinRAR’s Add recovery record). Without one, a damaged RAR can’t be repaired. When the record finds nothing wrong, nothing is written.
- Only single archives: a volume set is refused.
- The recovery record is reached through the archive’s headers, so a RAR whose headers are damaged can’t be repaired.
- A RAR 4 archive is repaired in memory and is refused over 1 GiB.
bench
Two benchmarks. With --codecs, every codec Arca writes is measured on data generated in memory, on one thread and on --threads; see Measure your own machine for the method and the rating. With an archive instead, the R1 and R2 performance requirements are measured against it.
arca bench --codecsarca bench --codecs --threads 4 --seconds 2 --jsonarca bench big.zipThe table and the JSON end with the command that reproduces them. Progress goes to standard error, and only when it is a terminal. Ctrl+C stops between runs, prints what was measured and exits with status 130.