2 <a href="https://crates.io/crates/ouch">
3 <img src="https://img.shields.io/crates/v/ouch?color=6090FF&style=flat-square" alt="Crates.io link">
5 <a href="https://docs.rs/ouch">
6 <img src="https://img.shields.io/docsrs/ouch?color=6090FF&style=flat-square" alt="Docs.rs link">
8 <a href="https://github.com/ouch/ouch-org/blob/master/LICENSE">
9 <img src="https://img.shields.io/crates/l/ouch?color=6090FF&style=flat-square" alt="License">
15 `ouch` stands for **Obvious Unified Compression Helper** and is a CLI tool to help you compress and decompress files of several formats.
17 - [Features](#features)
19 - [Installation](#installation)
20 - [Supported Formats](#supported-formats)
21 - [Benchmarks](#benchmarks)
22 - [Contributing](#contributing)
27 2. Automatic formats detection.
28 3. Same usage syntax for all formats.
29 4. Uses encoding and decoding streams to improve performance.
30 5. No runtime dependencies (for _Linux x86_64_).
31 6. Can list archive contents with pretty tree formatting.
32 7. Shell completions (soon!).
38 Use the `decompress` subcommand and pass the files.
44 # Decompress multiple files
45 ouch decompress a.zip b.tar.gz c.tar
51 The `-d/--dir` flag can be used to redirect decompression results to another directory.
54 # Decompress 'summer_vacation.zip' inside of new folder 'pictures'
55 ouch decompress summer_vacation.zip --dir pictures
60 Use the `compress` subcommand, pass the files and the **output file** at the end.
64 ouch compress 1 2 3 4 archive.zip
67 ouch c file.txt file.zip
70 `ouch` detects the extensions of the **output file** to decide what formats to use.
74 | Format | `.tar` | `.zip` | `.bz`, `.bz2` | `.gz` | `.lz4` | `.xz`, `.lzma` | `.zst` |
75 |:---------:|:------:|:------:|:-------------:|:-----:|:------:|:---------------------:|:------:|
76 | Supported | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
78 And the aliases: `tgz`, `tbz`, `tbz2`, `tlz4`, `txz`, `tlz`, `tlzma`, `tzst`.
80 Formats can be chained:
84 - `.tar.gz.gz.gz.gz.zst.xz.bz.lz4`
88 [![Packaging status](https://repology.org/badge/vertical-allrepos/ouch.svg)](https://repology.org/project/ouch/versions)
90 ## Downloading the latest binary
92 Compiled for `x86_64` on _Linux_, _Mac OS_ and _Windows_, run with `curl` or `wget`.
95 |:---------:|:------------------------------------------------------------------------------------|
96 | **curl** | `curl -s https://raw.githubusercontent.com/ouch-org/ouch/master/install.sh \| sh` |
97 | **wget** | `wget https://raw.githubusercontent.com/ouch-org/ouch/master/install.sh -O - \| sh` |
99 The script will copy the [latest binary](https://github.com/ouch-org/ouch/releases) to `/usr/local/bin`.
101 ## Compiling from source code
103 Check the [wiki guide](https://github.com/ouch-org/ouch/wiki/Compiling-and-installing-from-source-code).
107 If you installed `ouch` using the download script, you will need no dependencies (static MUSL binary).
109 Otherwise, you'll need these libraries installed on your system:
111 * [liblzma](https://www.7-zip.org/sdk.html)
112 * [libbz2](https://www.sourceware.org/bzip2/)
113 * [libz](https://www.zlib.net/)
115 These are available on all mainstream _Linux_ distributions and on _macOS_.
119 Comparison made decompressing `linux.tar.gz` and measured with
120 [Hyperfine](https://github.com/sharkdp/hyperfine) and the values presented are the average (wall clock) elapsed time.
122 | Tool | `ouch` | [`tar`] | [`bsdtar`] |
123 |:------------:|:------:|:-------:|:----------:|
124 | Average time | 911 ms | 1102 ms | 829 ms |
126 Note: `ouch` focuses heavily on usage ergonomics and nice error messages, but
127 we plan on doing some optimization in the future.
137 `ouch` is made out of voluntary work, contributors are very welcome! No contribution is too small and all contributions are valued.
139 - Open an [issue](https://github.com/ouch-org/ouch/issues).
140 - Package it for your favorite distribution or package manager.
141 - Open a pull request.
142 - Share it with a friend!
144 [`tar`]: https://www.gnu.org/software/tar/
145 [`bsdtar`]: https://www.freebsd.org/cgi/man.cgi?query=bsdtar&sektion=1&format=html