4
4

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コマンドaclsオプションの使い方

Posted at

まずは正解から。

$ tar --acls -cf suzaki-nishi.tar suzaki-nishi/

aclって何なの?

こちらを読んで下さい。

ITmedia エンタープライズ:特集:Linuxカーネル2.6で実現するACL (4/5)
http://www.itmedia.co.jp/enterprise/0403/06/epn01_4.html

なんで記事にしたの?

tarコマンドのオプションの扱いは他のコマンドと比べて特殊で、困惑することがままあります。

オプションの順番は自由だよね?

tar「やだよ」

$ tar suzaki-nishi.tar suzaki-nishi -cf
tar: Cannot update compressed archives
Try `tar --help' or `tar --usage' for more information.

オプションは-(ハイフン)を付けて指定するよね?

tar「別につけなくてもいいよ」

$ tar cf suzaki-nishi.tar suzaki-nishi/

aclsオプション指定してみたよ

tar「この場合は-いるよ」

$ tar --acls cf suzaki-nishi.tar suzaki-nishi
tar: You must specify one of the `-Acdtrux' or `--test-label'  options
Try `tar --help' or `tar --usage' for more information.

他にもいっぱいオプションあるんだけど使い方分からないんだけど

巨大(多機能)なオープンソースのプロジェクトではテストコードがソースに含まれているのが普通です。勿論、各オプションが機能するかどうかを評価するためのものなので、これとmanページを見ればほぼ解決できるでしょう。

$ wget http://ftp.gnu.org/gnu/tar/tar-1.28.tar.gz
$ tar xfz tar-1.28.tar.gz
$ cd tar-1.28
$ grep \\-\\-acls -r .
./tests/acls01.at:tar --acls -cf archive.tar dir
./tests/acls01.at:tar --acls -xf archive.tar
4
4
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
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?