rz
A multi-format archive tool written in Rust. Compress, decompress, test, list,
and inspect tar, zip, and 7z archives through a single, consistent CLI — no
more remembering whether it's tar xzf, unzip, or 7z x.
Supported formats
| Format | Extension(s) | Compression | Backend |
|---|---|---|---|
| tar | .tar |
none | tar |
| tar+gzip | .tar.gz, .tgz |
gzip | flate2 |
| tar+zstd | .tar.zst, .tzst |
Zstandard | ruzstd |
| tar+xz | .tar.xz, .txz |
LZMA2 | lzma-rs / xz2 |
| tar+bzip2 | .tar.bz2, .tbz2 |
bzip2 | bzip2 (opt-in) |
| zip | .zip |
Deflate | zip |
| 7z | .7z |
LZMA2 | sevenz-rust2 |
Format is auto-detected from the output extension (compress) or magic bytes
then extension (decompress/list/info). You can override with --format.
Installation
From source
With optional C-backed codecs
The default build is pure Rust. For faster xz and bzip2 via C libraries:
Nix
Or run directly:
Prebuilt binaries
Download from the releases page. Binaries are provided for Linux (x86_64, aarch64), macOS (x86_64, aarch64), and Windows (x86_64).
Usage
Compress
# Compress a directory (format inferred from extension)
# Compress multiple inputs
# Explicit format, custom compression level
# Exclude patterns (glob, repeatable)
# Compress to stdout (tar-based formats; requires --format)
|
# Short alias
Decompress
# Extract to current directory
# Extract to a specific directory
# Strip the top-level directory wrapper
# Exclude files during extraction
# Extract only matching files (--include glob or positional paths)
# Extract a file to stdout
# Read archive from stdin (tar-based formats; requires --format)
|
# Overwrite existing files
# Short alias
List
# List archive contents
# Detailed output (permissions, sizes)
# Filter listing
# Short alias
Test
# Verify archive integrity (fully decompress without writing to disk)
# ok
# Short alias
Info
# Show archive metadata
# Format: tar.gz
# Entries: 42
# Compressed: 1048576 bytes
# Uncompressed: 3145728 bytes
Global options
| Flag | Description |
|---|---|
-p, --progress |
Show a progress bar |
-v, --verbose |
Print each entry name to stderr |
-V, --version |
Print version |
-h, --help |
Print help |
Feature flags
| Feature | Effect |
|---|---|
xz2 |
Use C-backed liblzma for xz (streaming, faster) |
bzip2 |
Enable tar.bz2 support via C-backed libbz2 |
Without these features, xz uses the pure-Rust lzma-rs crate (buffers the
archive in memory before compressing) and bzip2 is unavailable.
Known limitations
- tar.zst compression level: The pure-Rust
ruzstdencoder currently only supports a single compression level (Fastest, roughly zstd level 1).--level 0selects uncompressed framing; all other values useFastest. - tar.xz / tar.zst memory usage: Without the
xz2feature, xz and zstd compression buffers the entire tar archive in memory before compressing. For large archives, consider enabling thexz2feature for streaming xz. - 7z format: Does not support
--strip-components. Extracts contents flat (does not preserve the top-level directory wrapper). - Stdin/stdout streaming: Only tar-based formats support
-for stdin/stdout. ZIP and 7z require seekable I/O and will error. - Symlinks: Followed during compression rather than stored as symlinks.