ouch

ouch-org活跃维护

命令行下的压缩解压工具,一条命令自动识别格式完成压缩或解压,省去记各种格式参数和命令的麻烦。

Painless compression and decompression in the terminal

0.8.3发布于 2026-09-13 15:53 UTC3,817star +2 / 7 天161fork同步于 2026-11-10 11:39 UTC

怎么上手

从 README 代码块原样提取,可能是其中一种安装方式
brew install ouch
cargo install ouch
git clone https://github.com/ouch-org/ouch
cargo build --locked --release --target <triple>
硬件要求

README 没有说明硬件要求。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

这个项目的说明还在生成中,先参考下面「最近发版」和 README。

最近发版

5 个版本0.8.3
  1. 0.8.3最新正式版2026-09-13 · 2026-09-13 15:53 UTC

    This is a hotfix version based on 0.8.2.

    • Fixes --version for packages that are built from source by avoid GitHub bug (read #1073).
  2. 0.8.22026-08-31 · 2026-08-31 03:13 UTC
    查看更新说明

    Fixes a bug introduced in 0.8.0.

    • Fixes zip archives that other tools can't read (#1018).
  3. 0.8.12026-07-04 · 2026-07-04 01:50 UTC
    查看更新说明

    Starting on this release, we'll stop updating the CHANGELOG.md and use the GitHub releases page instead.

    Highlighted changes:

    Other Changes

    Full Changelog: https://github.com/ouch-org/ouch/compare/0.8.0...0.8.1

  4. 0.8.02026-05-26 · 2026-05-26 08:03 UTC
    查看更新说明

    Updating to 0.8.0 is mandatory, it fixes a serious bug where ouch would think there is a conflict with the current folder and ask the user to overwrite it (possibly deleting user files in the process).

    Next up you should expect some security improvements, like Landlock sandboxing and safeguards against reading malicious archives.

    Packaging

    New Features

    Improvements

    Bug Fixes

    New Contributors

    And a big shoutout to @valoq and @tommady for the huge help.

    Full Changelog: https://github.com/ouch-org/ouch/compare/0.7.1...0.8.0

  5. 0.7.12026-04-22 · 2026-04-22 02:28 UTC
    查看更新说明

    0.7.1

    • Fix ouch --version.

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Ouch!

    ouch stands for Obvious Unified Compression Helper.

    It's a CLI tool for compressing and decompressing various formats.

    Features

    1. Easy to use.
    2. Fast.
    3. Great error message feedback.
    4. No runtime dependencies.
    5. Accessibility mode (see more).
    6. Shell completions and man pages.
    7. Decompression from standard input.

    Usage

    ouch has three main subcommands:

    • ouch decompress (alias d)
    • ouch compress (alias c)
    • ouch list (alias l or ls)

    To see help for a specific command:

    ouch help <COMMAND>
    ouch <COMMAND> --help  # equivalent
    

    Decompressing

    Use the decompress subcommand, ouch will detect the extensions automatically.

    ouch decompress a.zip
    
    # Decompress multiple files
    ouch decompress a.zip b.tar.gz c.tar
    

    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
    

    Files can also be decompressed from STDIN by passing - as the input path and providing the format with -f/--format (there is no path to infer the format from).

    # Decompress archive read from STDIN, writing contents to `ouch-output`
    cat a.tar.gz | ouch decompress - --format tar.gz
    

    Compressing

    Pass input files to the compress subcommand, add the output file at the end.

    # Compress two files into `archive.zip`
    ouch compress one.txt two.txt archive.zip
    
    # Compress file.txt using .lz4 and .zst
    ouch compress file.txt file.txt.lz4.zst
    

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

    Listing

    ouch list archive.zip
    
    # Example with tree formatting
    ouch list source-code.zip --tree
    
    # Show the (uncompressed) size of each file
    ouch list archive.zip --show-size
    

    Output:

    └── src
       ├── archive
       │  ├── mod.rs
       │  ├── tar.rs
       │  └── zip.rs
       ├── utils
       │  ├── colors.rs
       │  ├── formatting.rs
       │  ├── mod.rs
       │  └── fs.rs
       ├── commands
       │  ├── list.rs
       │  ├── compress.rs
       │  ├── decompress.rs
       │  └── mod.rs
       ├── accessible.rs
       ├── error.rs
       ├── cli.rs
       └── main.rs
    

    Supported formats

    Format.tar.zip.7z.gz.sz.zst.xz.lzma.lz.bz, .bz2.bz3.lz4.rar.br
    Supported✓✓¹✓¹✓²✓²✓²✓✓✓✓✓✓✓³✓

    ✓: Supports compression and decompression.

    ✓¹: Due to limitations of the compression format itself, (de)compression can't be done with streaming.

    ✓²: Supported, and compression runs in parallel.

    ✓³: Due to RAR's restrictive license, only decompression and listing can be supported.

    If you wish to exclude non-free code from your build, you can disable RAR support by building without the unrar feature.

    Aliases for these formats are also supported:

    • tar: tgz, tbz, tbz2, tlz4, txz, tlzma, tsz, tzst, tlz, cbt
    • zip: cbz, epub
    • 7z: cb7
    • rar: cbr

    Formats can be chained:

    • .tar.gz
    • .tar.gz.xz.zst.gz.lz4.sz

    If the filename has no extensions, ouch will try to infer the format by the file signature and ask the user for confirmation.

    Installation

    Refer to the packages list on the right.

    The most commonly used installation methods:

    On Arch Linux

    pacman -S ouch
    

    On MacOS via Homebrew

    brew install ouch
    

    On Windows via Scoop

    scoop install ouch
    

    From crates.io

    cargo install ouch
    

    (If you're on Ubuntu, you might need to install clang to build it from crates.io.)

    On Debian via pkg.haus

    Set up the pkg.haus APT archive per its instructions (packages for Debian stable, testing and unstable, amd64 and arm64, built from source at release tags), then:

    sudo apt install ouch
    

    Download the latest release bundle

    Check the releases page.

    Release binaries are signed with Sigstore using cosign. Download the asset and its .sigstore.json bundle from the releases page, then verify:

    cosign verify-blob ouch-x86_64-unknown-linux-musl.tar.gz --bundle ouch-x86_64-unknown-linux-musl.tar.gz.sigstore.json --certificate-identity-regexp='^https://github.com/ouch-org/ouch/' --certificate-oidc-issuer=https://token.actions.githubusercontent.com
    

    Reproducing a release build

    Release builds are reproducible. Given the source at a tagged commit, anyone can rebuild the same binary and check that it matches what we shipped. Steps:

    git clone https://github.com/ouch-org/ouch
    cd ouch
    git checkout <tag>
    export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)
    export RUSTFLAGS="--remap-path-prefix=$(pwd)=."
    cargo build --locked --release --target <triple>
    

    The toolchain version is pinned in rust-toolchain.toml and rustup will install it automatically. Cross-compiled targets (anything using cross-rs/cross) inherit the cross Docker image's toolchain, which is not pinned by digest yet, so those targets are bit-for-bit reproducible only against the same cross image release.

    Compiling from source code

    Check the wiki guide on compiling.

    Benchmarks

    Benchmark results are available here. Performance of compressing and decompressing Rust source code is measured and compared with Hyperfine. The values presented are the average (wall clock) elapsed time.

    Note: ouch focuses heavily on usage ergonomics and nice error messages, but we plan on doing some optimization in the future.

    Versions used:

    Contributing

    Contributions of all sizes are welcome and appreciated!

    • Open an issue.
    • Package it for your favorite distribution or package manager.
    • Share it with a friend!
    • Open a pull request.

    If you're creating a Pull Request, check CONTRIBUTING.md.