- 追加された行はこの色です。
- 削除された行はこの色です。
#topicpath
///////////////////////////////////////////////////////////////////////////////
* 目次 [#n249582f]
#contents();
///////////////////////////////////////////////////////////////////////////////
* ZIP [#h5fb2e12]
** 圧縮 [#pfdac5dc]
$ zip out.zip target-file
$ zip -r out.zip target-dir
** 暗号化圧縮 [#a556e192]
$ zip -e target -P
- 実行すると、解凍用のパスワードの入力を求められる。
- "-r" を付ければディレクトリを圧縮出来る。
** 解凍 [#d090228c]
$ unzip target.zip
///////////////////////////////////////////////////////////////////////////////
* tar + bzip2 [#p406c7dc]
** 圧縮 [#jef1708f]
$ tar -cvjf out.tar.bz2 target
** 解凍 [#se9f54e1]
$ tar -xvjf target.tar.bz2
///////////////////////////////////////////////////////////////////////////////
* tar + xz [#x78dca3d]
- Debian 6.x のtarは xzをサポートしているが、CentOS6.x では未サポート。
** 圧縮 [#v697447f]
$ tar -cvJf out.tar.xz target
** 解凍 [#wa78794b]
$ tar -xvJf target.tar.xz
- xz単体の解凍には、zip のように unxz コマンドも使えるし、 bzip2 のように "xz -d" も使える。
///////////////////////////////////////////////////////////////////////////////
* 高速圧縮 [#r721301e]
- Cpu の Core を全て使って圧縮する
** tar + pbzip2 [#ea0120fc]
$ tar -cvJf out.tar.bz2 --use-compress-program pbzip2 in-file
$ tar -cvf out.tar.bz2 --use-compress-program pbzip2 in-file
- どれくらい差が出るか?
|~CPU |>|>|>|Core i7-3520M (4-Core) |
|~target |>|>|>|linux-2.6.32.65 (439MB)|
|~tar + pbzip2 |~elapsed time |17.510 [sec] |~size |68824777 |
|~tar + bzip2 |~elapsed time |38.542 [sec] |~size |68701378 |
** tar + pigz [#ke1736a1]
$ tar -cvzf out.tar.gz --use-compress-program pigz in-file
$ tar -cvf out.tar.gz --use-compress-program pigz in-file