Unz!

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!
| 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 |
| 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.