目次 >> 圧縮、解凍
ここでは、ファイルの圧縮、解凍について説明する。
c:新規圧縮
x:解凍
f:ファイルを圧縮。通常はこれを指定する。さもないとテープデバイスなどになってしまう。
v:処理の詳細を表示
z:gzip圧縮を行う
j:bzip2圧縮を行う
J:xz圧縮を行う、現時点で最も高圧縮
gzip、bzip2、xzとも圧縮率を0から9で指定できる。0が無圧縮で、9が最も高圧縮となる。
xzではeを追加することによってさらに圧縮率を上げることができる。
これらのオプションは、直接は指定できないので、次のようにして指定すると良い。
xzであれば、XZ_OPTで指定する。
XZ_OPT=-9e tar cJf tarfile.tar.xz directory/files
gzipであれば、GZIPで指定する。
GZIP=-9 tar cvzf file.tar.gz directory/files
7zipをUbuntuで使うには、p7zip-fullをインストールすればよい。
$ sudo apt-get install p7zip-full Reading package lists... Done Building dependency tree Reading state information... Done Suggested packages: p7zip-rar The following NEW packages will be installed: p7zip-full 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 1561 kB of archives. After this operation, 3995 kB of additional disk space will be used. Get:1 http://us.archive.ubuntu.com/ubuntu/ precise/universe p7zip-full amd64 9.20.1~dfsg.1-4 [1561 kB] Fetched 1561 kB in 7s (217 kB/s) Selecting previously unselected package p7zip-full. (Reading database ... 395468 files and directories currently installed.) Unpacking p7zip-full (from .../p7zip-full_9.20.1~dfsg.1-4_amd64.deb) ... Processing triggers for man-db ... Setting up p7zip-full (9.20.1~dfsg.1-4) ...
-mx=9が最大圧縮となる。
最終更新日