Posted at

Mac で xz を使用する方法

More than 5 years have passed since last update.



  • OS: Mountain Lion

  • Homebrew 0.9.4


xz のインストール


$ brew install xz

xz の実行

xz --helpを実行すると、コマンド使用方法と、コマンドオプションが表示される。

$ xz --help

Usage: xz [OPTION]... [FILE]...
Compress or decompress FILEs in the .xz format.

-z, --compress force compression
-d, --decompress force decompression
-t, --test test compressed file integrity
-l, --list list information about .xz files
-k, --keep keep (don't delete) input files
-f, --force force overwrite of output file and (de)compress links
-c, --stdout write to standard output and don'
t delete input files
-0 ... -9 compression preset; default is 6; take compressor *and*
decompressor memory usage into account before using 7-9!
-e, --extreme try to improve compression ratio by using more CPU time;
does not affect decompressor memory requirements
-q, --quiet suppress warnings; specify twice to suppress errors too
-v, --verbose be verbose; specify twice for even more verbose
-h, --help display this short help and exit
-H, --long-help display the long help (lists also the advanced options)
-V, --version display the version number and exit


$ xz -z hoge

$ xz --compress hoge


$ xz -d hoge.xz

$ xz --decompress hoge.xz


$ unxz hoge.xz