0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

tar.gzやtazの解凍/圧縮コマンドとその意味

Posted at

いつもtarの解凍/圧縮を思考停止でググっていたけど、ついに意味を調べたのでメモ。

tar.gz taz

解凍 : -zxvf

tar -xzvf hogehoge.taz

- : なくても動く(すごいなぁ!)
x : extract。展開
z : gzip/bzip2/xz/lzma形式
v : verbose。展開のログなどを表示。
f : 解凍する元fileの選択。デフォルトでは/dev/rmt0を参照するらしい

ということで、短縮版

tar xzf hogehoge.tar.gz

となる。
当然、順番も変えられる。
ググるたびに、違うオプション(呪文)をコピペしてたのはこのせい。。。

圧縮

tar czfv hogehoge.tar.gz hoge.txt foge.txt goge.txt ...

c : compress

中身の確認

tar tzf hogehoge.tar.gz

t : test

version

検証したもの
MacOSのbrewで入れたtcshに入ってたやつ。

bsdtar 3.3.2 - libarchive 3.3.2 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.6

参考

teppeis blog

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?