unz

command module
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2026 License: MIT Imports: 12 Imported by: 0

README

Unz!

builds.sr.ht status

A no-fuzz unpacking tool with sane defaults. Supports multiple formats and protocols without having to memorize every tar flag or install any extra command line tools like unrar.

Smart enough to create a folder when the archive tries to flood your $PWD, also smart enough to not do it when there's just one file or folder in the archive. Neat!

Install

brew tap birkedal/unz https://git.sr.ht/~birkedal/homebrew-unz
brew install unz

Unpack things!

# Simple and easy
unz archive.tar.bz2

# Because why not
unz weird_archive.tar.gz.Z.bz2

# No `wget` followed by tar arguments and no .tar.gz artifact laying around
unz https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.0.1.tar.gz

# "I went ahead and put it in our S3 bucket"
unz s3://mylovelycoworker/files4friends/company_secrets.tar.bz2

# Extract everything!
unz file_*.zip

Speed

We are usually faster than native tar, but on bare .tar archives without compression we are a bit slower (0.89x) than regular tar, but for archives with loads of files we are even worse. On tar.bz2 we are almost 8x faster. Check BENCHMARK.md for some more details about my benchmarks and how you can run your own!

Supported Formats

Archive Formats
Format Extensions
7z .7z, .cb7
ar .ar, .a
bbf .bbf
cab .cab
cpio .cpio
deb .deb, .udeb, .ipk
erofs .erofs
iso .iso
lha .lha, .lzh
rar .rar, .cbr
rpm .rpm
sit .sit
squashfs .sqsh, .squashfs, .snap
tar .tar, .cbt
xar .xar, .pkg
zip .zip, .cbz, .jar, .war, .ear, .apk, .ipa, .epub, .docx, .xlsx, .pptx, .odt, .ods, .odp, .nupkg, .kmz
Compression Formats
Format Extensions
brotli .br
bzip2 .bz2, .bzip2, .tbz2
compress .Z
gzip .gz, .gzip, .tgz
lz4 .lz4
lzip .lz, .lzip, .tlz
lzma .lzma
lzo .lzo
snappy .sz, .snappy
xz .xz, .txz
zstd .zst, .zstd
Supported Protocols
Protocol Schemes Example
File file://, /path unz archive.tar.gz
HTTP http://, https:// unz https://example.com/archive.tar.gz
S3 s3:// unz s3://bucket/key.tar.gz
SFTP sftp://, scp:// unz sftp://host/path/archive.tar.gz
FTP ftp:// unz ftp://host/path/archive.tar.gz

Contribute

Yes, please. Check out CONTRIBUTE.md.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
gendocs command
Command gendocs generates format documentation for the README.
Command gendocs generates format documentation for the README.
internal
formats/allformats
Package allformats imports every format package to trigger init() self-registration.
Package allformats imports every format package to trigger init() self-registration.
tui

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL