7zip は使い勝手良くコマンドでも使える。
準備
Windowsの場合
7zip portable がオススメ。
Linuxの場合
yum install p7zip
とか。
使い方
圧縮
7zip a test.7z test.txt testdir
a は add の意味。
ディレクトリを指定する場合、サブディレクトリも含めて全てアーカイブされる。
タイプ
アーカイブの際にzipや7zipなどアーカイブの種類を指定できる。
アーカイブの種類は、 -t オプションを指定する。
指定しない場合は、出力先のアーカイブの拡張子によって決まる。
7zip a test.zip hoge
はzip形式になる。アーカイブの種類を確認するには
7zip l test.zip
で確認できる。
相対パスと絶対パス
アーカイブ内に絶対パスを入れることはできない。
絶対パスを指定すると指定したパスをルートとしてアーカイブする。
相対パスを指定すると指定したパスの構成のままアーカイブする。
[home] |-temp <- 作業ディレクトリ |- test2 |-test3 |- hoge.txt
がある場合、
7zip a test.7z test2 7zip l test.7z Date Time Attr Size Compressed Name ------------------- ----- ------------ ------------ ------------------------ 2014-01-07 19:53:32 ....A 2 7 test2/test3/hoge.txt 2014-01-07 19:53:32 D.... 0 0 test2/test3 2014-01-07 19:50:27 D.... 0 0 test2 ------------------- ----- ------------ ------------ ------------------------
7zip a test.7z test2/test3/ 7zip l test.7z Date Time Attr Size Compressed Name ------------------- ----- ------------ ------------ ------------------------ 2014-01-07 19:53:32 ....A 2 7 test2/test3/hoge.txt 2014-01-07 19:53:32 D.... 0 0 test2/test3 ------------------- ----- ------------ ------------ ------------------------
7zip a test.7z ~/temp/test2/test3/ 7zip l test.7z Date Time Attr Size Compressed Name ------------------- ----- ------------ ------------ ------------------------ 2014-01-07 19:53:32 ....A 2 7 test3/hoge.txt 2014-01-07 19:53:32 D.... 0 0 test3 ------------------- ----- ------------ ------------ ------------------------
中身の確認
7zip l test.7z
でアーカイブの中身を確認できる。
解凍
7zip x test.7z
解凍先を指定する場合は
7zip x test -o outdir
ディレクトリ構成を無視して解凍する
7zip e test.7z
全て同じディレクトリに解凍される
[カテゴリ: ツール > ファイル]
[通知用URL]
Tweet
最終更新時間:2014年01月07日 20時37分04秒