dポイントプレゼントキャンペーン実施中!

Linux Redhatを使っています。
非常に大きなバックアプファイル(*.tgzファイル)があるのですが、
全部を解凍するスペースがなく、一部のデータのみ必要になっています。この一部のデータだけを解凍することは可能なのでしょうか?
よろしくお願いします。

A 回答 (3件)

↓な感じ。



%ls -l test/
total 0
%tar tvzf test.tgz
drwxr-xr-x 0 lean wheel 0 10 31 23:52 test
-rw-r--r-- 0 lean wheel 0 10 31 23:52 test/file00
-rw-r--r-- 0 lean wheel 0 10 31 23:52 test/file10
-rw-r--r-- 0 lean wheel 0 10 31 23:52 test/file01
-rw-r--r-- 0 lean wheel 0 10 31 23:52 test/file11
-rw-r--r-- 0 lean wheel 0 10 31 23:52 test/file02
-rw-r--r-- 0 lean wheel 0 10 31 23:52 test/file12
-rw-r--r-- 0 lean wheel 0 10 31 23:52 test/file03
-rw-r--r-- 0 lean wheel 0 10 31 23:52 test/file13
-rw-r--r-- 0 lean wheel 0 10 31 23:52 test/file04
-rw-r--r-- 0 lean wheel 0 10 31 23:52 test/file14
-rw-r--r-- 0 lean wheel 0 10 31 23:52 test/file05
-rw-r--r-- 0 lean wheel 0 10 31 23:52 test/file15
-rw-r--r-- 0 lean wheel 0 10 31 23:52 test/file06
-rw-r--r-- 0 lean wheel 0 10 31 23:52 test/file16
-rw-r--r-- 0 lean wheel 0 10 31 23:52 test/file07
-rw-r--r-- 0 lean wheel 0 10 31 23:52 test/file17
-rw-r--r-- 0 lean wheel 0 10 31 23:52 test/file09
-rw-r--r-- 0 lean wheel 0 10 31 23:52 test/file19
%tar xvzf test.tgz test/file05
x test/file05
%ls -l test/
total 0
-rw-r--r-- 1 lean wheel 0 10 31 23:52 file05
    • good
    • 0
この回答へのお礼

例と共にご教示ありがとうございました。非常に良く分かりました。

ご連絡遅くなって申し訳ありませんでした。今後ともよろしくお願いします。

お礼日時:2007/10/09 09:29

可能ですね。



tgz = tar + gzip ということが理解できれば、さして難しい問題ではないはずですよ?

たとえば、以下の方法が考えられますね。
$ gzip -dc <tgz file> | tar xf - <extract filename>
    • good
    • 0
この回答へのお礼

ご教示ありがとうございました。2段階でもできるのですね。

今後ともよろしくお願いします。

お礼日時:2007/10/09 09:29

tar xvfz aaaaa.tgz 欲しいファイル名


これで必要なファイルだけを取り出せます。
    • good
    • 0
この回答へのお礼

ご教示ありがとうございます。おかげさまでうまく行きました。

ご連絡遅くなってすみませんでした。今後ともよろしくお願い致します。

お礼日時:2007/10/09 09:30

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!