在终端中轻松压缩和解压缩
ouch 代表 Obvious Unified Compression Helper(直观统一压缩助手)。
它是一个用于压缩和解压各种格式的命令行工具。
ouch 有三个主要子命令:
ouch decompress(别名 d)ouch compress(别名 c)ouch list(别名 l 或 ls)要查看特定命令的 help:
ouch help <COMMAND>
ouch <COMMAND> --help # equivalent使用 decompress 子命令,ouch 会自动检测扩展名。
ouch decompress a.zip
# Decompress multiple files
ouch decompress a.zip b.tar.gz c.tar-d/--dir 标志可用于将解压结果重定向到另一个目录。
# Decompress 'summer_vacation.zip' inside of new folder 'pictures'
ouch decompress summer_vacation.zip --dir pictures文件也可以通过传入 - 作为输入路径并从 STDIN 解压,同时使用 -f/--format 提供格式(因为没有路径可以推断格式)。
# Decompress archive read from STDIN, writing contents to `ouch-output`
cat a.tar.gz | ouch decompress - --format tar.gz将输入文件传给 compress 子命令,并在末尾添加输出文件。
# 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.zstouch 会根据输出文件的扩展名来决定使用哪种格式。
ouch list archive.zip
# 使用树形格式的示例
ouch list source-code.zip --tree
# 显示每个文件的(未压缩)大小
<a href="https://crates.io/crates/ouch">
<a href="https://github.com/ouch-org/ouch/blob/main/LICENSE">暂无开放 Issues,或尚未同步最近议题。