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 3 years have passed since last update.

tarコマンドよくつかうオプションまとめ

Posted at

概要

(個人的に)よく使うtarコマンドのオプションをまとめました。

tarコマンドとは

アーカイブファイルを作成・展開するコマンド。

一般的なWindowsにおけるファイル操作で、右クリックなどで"ファイルを圧縮・展開する"という動作を、
実行できるLinuxコマンドという認識。

ファイルを圧縮する基本コマンド

tar -czv 対象ファイル

-c: 新しいアーカイブを作成する

-z: アーカイブをgzip形式で圧縮する

-v: 処理内容を出力する

他の圧縮時によく使うオプション

-f: 出力するアーカイブ名を指定して圧縮する。拡張子を指定する時にも使えそう。
tar -czvf <アーカイブ名.tgz> <圧縮するファイル>

ファイルを展開する基本コマンド

tar -xzvf アーカイブ.tgz

-x: アーカイブファイルを展開する

-z: gzip形式のアーカイブを展開する

-f: 対象のアーカイブ名を指定する

参考

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?