ouch/README.md
2021-11-04 02:55:25 -03:00

4.0 KiB

Crates.io link Docs.rs link License

Ouch!

ouch stands for Obvious Unified Compression Helper, it's a CLI tool to compress and decompress files.

Features

  1. Easy to use.
  2. Automatic format detection.
  3. Same syntax, various formats.
  4. Encoding and decoding streams, it's fast.
  5. No runtime dependencies (for Linux x86_64).
  6. Listing archive contents with tree formatting (in next release!).

Usage

Decompressing

Use the decompress subcommand and pass the files.

# Decompress one
ouch decompress a.zip

# Decompress multiple
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

# Compress everything in the current folder again and again
ouch compress * everything.tar.gz.xz.bz.zst.gz.gz.gz.gz.gz

ouch detects the extensions of the output file to decide what formats to use.

Installation

Packaging status

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.

Installing from source code

Check the wiki guide.

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

Benchmarks

Comparison made decompressing linux.tar.gz and measured with hyperfine, times are the average.

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, any small contribution is welcome!

  • Open an issue.
  • Open a pull request.
  • Share it to a friend!