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://github.com/ouch/ouch-org/blob/master/LICENSE">
6 <img src="https://img.shields.io/crates/l/ouch?color=6090FF&style=flat-square" alt="License">
12 `ouch` stands for **Obvious Unified Compression Helper**.
14 It's a CLI tool for compressing and decompressing for various formats.
16 - [Features](#features)
18 - [Installation](#installation)
19 - [Supported Formats](#supported-formats)
20 - [Benchmarks](#benchmarks)
21 - [Contributing](#contributing)
27 3. Great error message feedback.
28 4. No runtime dependencies required (for _Linux x86_64_).
29 5. Accessibility mode ([see more](https://github.com/ouch-org/ouch/wiki/Accessibility)).
30 6. Shell completions and man pages.
34 Ouch has three main subcommands:
36 - `ouch decompress` (alias `d`)
37 - `ouch compress` (alias `c`)
38 - `ouch list` (alias `l`)
42 Use the `decompress` subcommand, `ouch` will detect the extensions automatically.
47 # Decompress multiple files
48 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 Pass input files to the `compress` subcommand, add the **output file** at the end.
63 # Compress two files into `archive.zip`
64 ouch compress one.txt two.txt archive.zip
66 # Compress file.txt using .lz4 and .zst
67 ouch compress file.txt file.txt.lz4.zst
70 `ouch` detects the extensions of the **output file** to decide what formats to use.
77 # Example with tree formatting
78 ouch list source-code.zip --tree
107 | Format | `.tar` | `.zip` | `.gz` | `.xz`, `.lzma` | `.bz`, `.bz2` | `.lz4` | `.sz` | `.zst` |
108 |:---------:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
109 | Supported | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
111 And the aliases: `tgz`, `tbz`, `tbz2`, `tlz4`, `txz`, `tlzma`, `tsz`, `tzst`.
113 Formats can be chained:
117 - `.tar.gz.gz.gz.gz.zst.xz.bz.lz4`
121 [![Packaging status](https://repology.org/badge/vertical-allrepos/ouch.svg)](https://repology.org/project/ouch/versions)
135 ## Using our script to download the latest binary
137 Compiled for `x86_64` on _Linux_, _Mac OS_ and _Windows_, run with `curl` or `wget`.
140 |:---------:|:------------------------------------------------------------------------------------|
141 | **curl** | `curl -s https://raw.githubusercontent.com/ouch-org/ouch/master/install.sh \| sh` |
142 | **wget** | `wget https://raw.githubusercontent.com/ouch-org/ouch/master/install.sh -O - \| sh` |
144 The script will copy the [latest binary](https://github.com/ouch-org/ouch/releases) to `/usr/local/bin`.
146 ## Compiling from source code
148 Check the [wiki guide on compiling](https://github.com/ouch-org/ouch/wiki/Compiling-and-installing-from-source-code).
152 If you installed `ouch` using the download script, you will need no dependencies (static MUSL binary).
154 Otherwise, you'll need these libraries installed on your system:
156 * [liblzma](https://www.7-zip.org/sdk.html)
157 * [libbz2](https://www.sourceware.org/bzip2/)
158 * [libz](https://www.zlib.net/)
160 These are available on all mainstream _Linux_ distributions and on _macOS_.
164 Comparison made decompressing `linux.tar.gz` and measured with
165 [Hyperfine](https://github.com/sharkdp/hyperfine) and the values presented are the average (wall clock) elapsed time.
167 | Tool | `ouch` | [`tar`] | [`bsdtar`] |
168 |:------------:|:------:|:-------:|:----------:|
169 | Average time | 911 ms | 1102 ms | 829 ms |
171 Note: `ouch` focuses heavily on usage ergonomics and nice error messages, but
172 we plan on doing some optimization in the future.
182 `ouch` is made out of voluntary work, contributors are very welcome! No contribution is too small and all contributions are valued.
184 - Open an [issue](https://github.com/ouch-org/ouch/issues).
185 - Package it for your favorite distribution or package manager.
186 - Open a pull request.
187 - Share it with a friend!
189 [`tar`]: https://www.gnu.org/software/tar/
190 [`bsdtar`]: https://www.freebsd.org/cgi/man.cgi?query=bsdtar&sektion=1&format=html