chgrp
chgrp是一条在Unix系统中用于设置文档所归属的组的命令。与chown命令不同,chgrp允许普通用户改变文档所属的组,只要该用户是该组的一员。
使用方法
调用chgrp的语法为
chgrp 组名 目标1 [目标2 ...]
- "组名"是文档即将关联的组。
- "目标1 [目标2 ...]"是需要改变组的文档或目录的列表。
备注:"组名"既可以使用字符名称也可以使用ID。
范例
$ls -l testfile
-rw-r--r-- 1 unixguy staff 545 Nov 04 2004 ttt
$chgrp system testfile
$ls -l ttt
-rw-r--r-- 1 unixguy system 545 Nov 04 2004 ttt
上述命令将文档"testfile"所属的组从"staff"改成了"system"。(执行命令者必须属于"system"组。)
参看
- chown
- 组标识符
外部链接
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.