LoginSignup
26
23

More than 5 years have passed since last update.

Mac で xz を使用する方法

Posted at

Macではデフォルトでxzコマンドを使用できないため、下記の設定が必要となる。

環境

  • 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コマンドも使用可能。

$ unxz hoge.xz
26
23
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
26
23