mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-05 02:55:31 +00:00
parent
9d7c8a9abb
commit
765fb40ec7
109
README.md
109
README.md
@ -2,124 +2,97 @@
|
||||
|
||||
[](https://crates.io/crates/ouch) [](https://github.com/ouch-org/ouch/blob/main/LICENSE)
|
||||
|
||||
<!--  -->
|
||||
|
||||
`ouch` stands for **Obvious Unified Compression Helper**, and works on _Linux_, _Mac OS_ and _Windows_.
|
||||
|
||||
It is a CLI tool to compress and decompress files that aims on ease of usage.
|
||||
|
||||
<!-- TODO -->
|
||||
<!-- - [Listing files](#Listing-the-elements-of-an-archive) -->
|
||||
`ouch` stands for **Obvious Unified Compression Helper**, it's a CLI tool to compress and decompress files.
|
||||
|
||||
- [Features](#features)
|
||||
- [Usage](#usage)
|
||||
- [Decompressing](#decompressing)
|
||||
- [Compressing](#compressing)
|
||||
- [Installation](#installation)
|
||||
- [Latest binary](#downloading-the-latest-binary)
|
||||
- [Compiling from source](#installing-from-source-code)
|
||||
- [Supported Formats](#supported-formats)
|
||||
- [Contributing](#contributing)
|
||||
|
||||
## Features
|
||||
|
||||
1. Easy to use.
|
||||
2. Automatic format detection.
|
||||
3. Same syntax, various formats.
|
||||
4. Encoding and decoding streams, it's fast. <!-- We should post benchmarks in our wiki and link them here -->
|
||||
|
||||
## Usage
|
||||
|
||||
### Decompressing
|
||||
|
||||
Run `ouch` and pass compressed files as arguments.
|
||||
Use the `decompress` subcommand and pass the files.
|
||||
|
||||
```sh
|
||||
# Decompress 'a.zip'
|
||||
# Decompress one
|
||||
ouch decompress a.zip
|
||||
|
||||
# Also works with the short version
|
||||
ouch d a.zip
|
||||
# Decompress multiple
|
||||
ouch decompress a.zip b.tar.gz c.tar
|
||||
|
||||
# Decompress multiple files
|
||||
ouch decompress a.zip b.tar.gz
|
||||
# Short alternative
|
||||
ouch d a.zip
|
||||
```
|
||||
|
||||
You can redirect the decompression results to a folder with the `-o/--output` flag.
|
||||
You can redirect the decompression results to another folder with the `-o/--output` flag.
|
||||
|
||||
```sh
|
||||
# Create 'pictures' folder and decompress inside of it
|
||||
ouch decompress a.zip -o pictures
|
||||
# Decompress 'summer_vacation.zip' inside of new folder 'pictures'
|
||||
ouch decompress summer_vacation.zip -o pictures
|
||||
```
|
||||
|
||||
### Compressing
|
||||
|
||||
Use the `compress` subcommand.
|
||||
|
||||
Accepts multiple files and folders, the **last** argument shall be the **output file**.
|
||||
Use the `compress` subcommand, pass the files and the **output file** at the end.
|
||||
|
||||
```sh
|
||||
# Compress four files into 'archive.zip'
|
||||
# Compress four files/folders
|
||||
ouch compress 1 2 3 4 archive.zip
|
||||
|
||||
# Also works with the short version
|
||||
ouch c 1 2 3 4 archive.zip
|
||||
# Short alternative
|
||||
ouch c file.txt file.zip
|
||||
|
||||
# Compress folder and video into 'videos.tar.gz'
|
||||
ouch compress videos/ meme.mp4 videos.tar.gz
|
||||
|
||||
# Compress one file using 4 compression formats
|
||||
ouch compress file.txt compressed.gz.xz.bz.zst
|
||||
|
||||
# Compress all the files in current folder
|
||||
ouch compress * files.zip
|
||||
# Compress everything in the current folder again and again
|
||||
ouch compress * everything.tar.gz.xz.bz.zst.gz.gz.gz.gz.gz
|
||||
```
|
||||
|
||||
`ouch` checks for the extensions of the **output file** to decide which formats should be used.
|
||||
|
||||
<!-- ### Listing the elements of an archive
|
||||
|
||||
* **Upcoming feature**
|
||||
|
||||
```
|
||||
# Shows the files and folders contained in videos.tar.xz
|
||||
ouch list videos.tar.xz
|
||||
``` -->
|
||||
|
||||
## Installation
|
||||
|
||||
### Downloading the latest binary
|
||||
|
||||
Download the script with `curl` and run it.
|
||||
Compiled for `x86_64` on _Linux_, _Mac OS_ and _Windows_, run with `curl` or `wget`.
|
||||
|
||||
```sh
|
||||
curl -s https://raw.githubusercontent.com/ouch-org/ouch/master/install.sh | sh
|
||||
```
|
||||
| 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` |
|
||||
|
||||
Or with `wget`.
|
||||
|
||||
```sh
|
||||
wget https://raw.githubusercontent.com/ouch-org/ouch/master/install.sh -O - | sh
|
||||
```
|
||||
|
||||
The script will download the latest binary and copy it to `/usr/bin`.
|
||||
The script will download the [latest binary](https://github.com/ouch-org/ouch/releases) and copy it to `/usr/bin`.
|
||||
|
||||
### Installing from source code
|
||||
|
||||
For compiling, check [the wiki guide](https://github.com/ouch-org/ouch/wiki/Compiling-and-installing-from-source-code).
|
||||
|
||||
For compiling, check the [wiki guide](https://github.com/ouch-org/ouch/wiki/Compiling-and-installing-from-source-code).
|
||||
|
||||
## Supported formats
|
||||
|
||||
| | .tar, .tgz | .zip | .bz, .bz2 | .gz | .xz, .lz, .lzma | .zst |
|
||||
| Format | .tar | .zip | .bz, .bz2 | .gz | .xz, .lz, .lzma | .zst |
|
||||
|:-------------:|:----:|:----:|:---------:| --- |:---------------:| --- |
|
||||
| Decompression | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| Compression | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| Supported | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
|
||||
Note that formats can be chained:
|
||||
- `.tar.gz`
|
||||
- `.tar.xz`
|
||||
- `.tar.gz.xz`
|
||||
- `.tar.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.lz.lz.lz.lz.lz.lz.lz.lz.lz.lz.bz.bz.bz.bz.bz.bz.bz`
|
||||
- `.gz.xz`
|
||||
- etc...
|
||||
And the aliases: `tgz`, `tbz`, `tbz2`, `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`
|
||||
-
|
||||
## Contributing
|
||||
|
||||
`ouch` is 100% made out of voluntary work, any small contribution is welcome!
|
||||
|
||||
- Open an issue.
|
||||
- Open a pr.
|
||||
- Share it to a friend.
|
||||
- Open a pull request.
|
||||
- Share it to a friend!
|
||||
|
Loading…
x
Reference in New Issue
Block a user