Chgrp

chgrp(チェンジグループ、change group)は、Unix系システムの一般ユーザーがファイルのグループを変更するためのコマンドである。chown コマンドとは異なり、chgrp は一般ユーザーがグループ識別子を変更するのに使えるが、そのユーザーがメンバーとなっているグループにしか変更できない。

使用法

chgrp コマンドの一般的構文は以下の通り。

chgrp group target1 [target2 ..]
  • group は対象ファイルに設定しようとしている新しいグループである。
  • target1 は対象となるファイルまたはディレクトリである。
  • target2 は対象となるファイルやディレクトリが複数ある場合に指定する。

なお、group/etc/group で定義されるグループ名でもよいし、識別子でもよい。

使用例

$ls -l ttt
-rw-r--r--   1 gbeeker  staff           545 Nov 04 2004  ttt
$chgrp system ttt
$ls -l ttt
-rw-r--r--   1 gbeeker  system          545 Nov 04 2004  ttt

この例では、ttt のグループを 'system' に変更しているが、これを実行するユーザーはそのグループのメンバーである。

関連項目

外部リンク

  • chgrp(1) - Linux JM Project
  • chgrp(1) - OpenBSD(英語)
  • chgrp(1) - HMUGリファレンスマニュアル(英語)
  • chgrp(1) - Debianリファレンスマニュアル(日本語)
Unixコマンド
ファイルとファイルシステム管理
  • cat
  • chattr(英語版)
  • chmod
  • chown
  • chgrp
  • cksum
  • cmp
  • cp
  • dd
  • du
  • df(英語版)
  • file
  • fsck
  • fuser(英語版)
  • ln
  • ls
  • lsof
  • mkdir
  • mount
  • mv
  • pax
  • pwd
  • rm
  • rmdir
  • size
  • split
  • tee
  • touch
  • type(英語版)
  • umask(英語版)
プロセス管理
ユーザ管理/環境
テキスト処理
シェルビルトイン
通信
検索
  • find
  • grep
  • locate(英語版)
  • whatis(英語版)
  • whereis(英語版)
マニュアル
  • apropos(英語版)
  • help(英語版)
  • man
ソフトウェア開発
その他
  • bc
  • dc
  • cal
  • date
  • expr
  • false
  • lp(英語版)
  • lpr
  • od
  • sl
  • sleep
  • stty
  • true
  • tty