mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-06 11:35:45 +00:00

Rewrote decompression to use chained decoders, creating a stream and avoiding in-memory decompression, which caused redundant copying. Now ouch supports any number of extensions as decompressing formats, not only two.
Ouch!
ouch
loosely stands for Obvious Unified Compression files Helper.
It is an easy and painless way of compressing and decompressing files in the terminal.
Works in Linux
, Mac OS
and Windows
.
Usage
Decompressing
Run ouch
and pass compressed files as arguments.
# Decompress `a.zip`
ouch a.zip
# Decompress multiple files
ouch a.zip b.tar.gz
Use the -o/--output
flag to redirect the output of decompressions to a folder.
# Decompress multiple files but inside new_folder
ouch a.zip b.tar.gz c.tar.bz2 -o new_folder
Compressing
Use the compress
subcommand.
Accepts files and folders, and the last argument shall be the output file.
# Compress four files into `archive.zip`
ouch compress 1 2 3 4 archive.zip
The supplied output file shall have a supported compression format, see the list.
You can also use the c
alias for this subcommand.
# Compress a folder and a file into `videos.tar.xz`
ouch c Videos/ funny_meme.mp4 videos.tar.xz
# Compress three files into a `.tar.bz2` archive
ouch c a.mp4 b.jpg c.png files.tar.bz2
# Compress two folders into a lzma file
ouch c src/ target/ build.tar.lz
Installation
Installing a binary
This script downloads the latest binary and copies it to /usr/bin
.
curl -s https://raw.githubusercontent.com/vrmiguel/ouch/master/install.sh | sh
Compiling
Install Rust and Cargo via rustup.rs.
From latest official release:
cargo install ouch
From repository source code:
git clone https://github.com/vrmiguel/ouch
cargo build
Supported formats
.tar | .zip | .tar.*¹ | .zip.*² | .bz, .bz2 | .gz | .xz, .lz, .lzma | .7z | |
---|---|---|---|---|---|---|---|---|
Decompression | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✗ |
Compression | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✗ |
Note: .tar.*¹: .tar.gz, .tar.bz, .tar.bz2, .tar.xz, .tar.lz, .tar.lzma, .tar.zip
.zip.*²: .zip.gz, .zip.bz, .zip.bz2, .zip.xz, .zip.lz, .zip.lzma, .zip.zip
Languages
Rust
97.2%
Shell
2.6%
Nix
0.2%