オブジェクト指向とかデザインパターンとか開発プロセスとかツールとか

satoshi's ソフトウェア開発

js






当サイトはアフィリエイト広告を利用してます。

misc

Macでxz形式の圧縮ファイルを解凍する方法

更新日:


PINE64 の Armbian Ubuntu の OSイメージをダウンロードしてみると、拡張子が xz になってました。

xz形式って始めて見たような。

ぐぐってみたら、xz コマンドを使うと解凍できるみたいです。

Linux で tar.xz 形式のファイルを解凍する

「Linuxで」となってますが、Macでも xz コマンドが使えるようです。

過去にいろいろとインストールしているので、その際に一緒にインストールされていたのかもしれません。

上記サイトでは xz形式で圧縮された tarアーカイブ解凍をしていますが、解凍したいファイルはOSイメージを圧縮しているだけなので、tar形式のアーカイブではないです。

だから、tar は不要ですね。

とりあえずヘルプを見て、コマンドの意味を確認しておきましょう。

% 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
  -T, --threads=NUM   use at most NUM threads; the default is 1; set to 0
                      to use as many threads as there are processor cores
  -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

With no FILE, or when FILE is -, read standard input.

Report bugs to <lasse.collin@tukaani.org> (in English or Finnish).
XZ Utils home page: <https://tukaani.org/xz/>

cオプションは、パイプで tar に解凍したデータを渡すためにつけているみたいですね。

ということは、単純に解凍するだけなら dオプションだけでよさそうです。

% xz -d Armbian_22.02.2_Pine64_focal_current_5.15.26_xfce_desktop.img.xz

これで無事に解凍できました。







-misc
-, , , ,

Copyright© satoshi's ソフトウェア開発 , 2024 All Rights Reserved Powered by STINGER.