chgrpコマンドの説明します。

説明

chgrpはファイルやディレクトリのグループを変更するコマンドです。

使い方:chgrp [ グループ名 [ ファイル名 ]]
読み方:チェンジグループ
  略:change group

具体例

# ■■■ 1.準備準備
[root@CE08PRD101 ~]# mkdir -p /work/chgrp;cd /work/chgrp;pwd
/work/chgrp

# テストファイル作成
[root@CE08PRD101 chgrp]# touch test.txt

# テストユーザ作成
[root@CE08PRD101 chgrp]# groupadd test

# ■■■ 2.事前確認
[root@CE08PRD101 chgrp]# ll
合計 0
-rw-r--r--. 1 root root 0 9月 24 20:16 test.txt

# ■■■ 3.グループ変更
[root@CE08PRD101 chgrp]# chgrp test test.txt

# ■■■ 4.事後確認
# グループがtestに変更されたことを確認する
[root@CE08PRD101 chgrp]# ll
合計 0
-rw-r--r--. 1 test root 0 9月 24 20:16 test.txt

# テストグループ削除
[root@CE08PRD101 chgrp]# groupdel test

# テストファイル・ディレクトリ削除
[root@CE08PRD101 chgrp]# cd ../;rm -fr chgrp