
* Updating badges * Reformatted support table to be monospaced * Add first benchmark to the readme And fixed a typo * Some readme rewording * Removing readme redundant compression example * Change badges to have squared corners * readme: increase headers size by one * Slight modifications to the README * Specify dependencies and tweak some other stuff * Add MSRV Co-authored-by: Vinícius Miguel <36349314+vrmiguel@users.noreply.github.com>
4.8 KiB
Ouch!
ouch
stands for Obvious Unified Compression Helper and is a CLI tool to help you compress and decompress files of several formats.
Features
- Easy to use.
- Infers expression formats automatically.
- Uses the same usage syntax for all supported formats.
- Achieves great performance through encoding and decoding streams.
- No runtime dependencies (for Linux x86_64).
- Listing archive contents with tree formatting (in next release!).
Usage
Decompressing
Use the decompress
subcommand and pass the files.
# Decompress a file
ouch decompress a.zip
# Decompress multiple files
ouch decompress a.zip b.tar.gz c.tar
# Short alternative
ouch d a.zip
The -d/--dir
flag can be used to redirect decompression results to another directory.
# Decompress 'summer_vacation.zip' inside of new folder 'pictures'
ouch decompress summer_vacation.zip --dir pictures
Compressing
Use the compress
subcommand, pass the files and the output file at the end.
# Compress four files/folders
ouch compress 1 2 3 4 archive.zip
# Short alternative
ouch c file.txt file.zip
ouch
detects the extensions of the output file to decide what formats to use.
Supported formats
Format | .tar |
.zip |
.bz , .bz2 |
.gz |
.lz4 |
.xz , .lz , .lzma |
.zst |
---|---|---|---|---|---|---|---|
Supported | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
And the aliases: tgz
, tbz
, tbz2
, tlz4
, txz
, tlz
, tlzma
, tzst
.
Formats can be chained (ouch
keeps it fast):
.gz.xz.bz.zst
.tar.gz.xz.bz.zst
.tar.gz.gz.gz.gz.xz.xz.xz.xz.bz.bz.bz.bz.zst.zst.zst.zst
Installation
Downloading the latest binary
Compiled for x86_64
on Linux, Mac OS and Windows, run with curl
or wget
.
Method | Command |
---|---|
curl | curl -s https://raw.githubusercontent.com/ouch-org/ouch/master/install.sh | sh |
wget | wget https://raw.githubusercontent.com/ouch-org/ouch/master/install.sh -O - | sh |
The script will copy the latest binary to /usr/local/bin
.
Minimum Supported Rust Version
ouch
will always be developed with the latest stable release of the Rust toolchain.
Installing from source code
Check the wiki guide.
Dependencies
When built dynamically linked, you'll need these libraries to be available on your system:
Thankfully these are all very common libraries that should already be available on all mainstream Linux distributions and on macOS.
ouch
is also easily built with MUSL, in which case it's statically linked and therefore has no runtime dependencies.
Benchmarks
Comparison made decompressing linux.tar.gz
and measured with
Hyperfine and the values presented are the average (wall clock) elapsed time.
Tool | ouch |
tar |
bsdtar |
---|---|---|---|
Average time | 911 ms | 1102 ms | 829 ms |
Note: ouch
focuses heavily on usage ergonomics and nice error messages, but
we plan on doing some optimization in the future.
Versions used:
Contributing
ouch
is made out of voluntary work, contributors are very welcome! No contribution is too small and all contributions are valued.
- Open an issue.
- Package it for your favorite distribution or package manager.
- Open a pull request.
- Share it with a friend!