名称
chgrp - 改变文件的组所有权
总览
chgrp [选项] 组文件...
POSIX 选项: [-R] [--]
Austin 草拟选项: [-hHLPR]
GNU 团体指示: [--reference=rfile]
GNU 选项 (简易格式): [-cfvR] [--help] [--version]
描述
chgrp 为给出的 file(文件) 改变它的组所有权. group(组), 可以是组名和组ID数字两者之一.
POSIX 选项
- -R
- 递归的改变目录和它的内容的组所有权 (即使遇到错误也继续.)
- --
- 结束选项列表.
AUSTIN 草拟选项
- -h
- 对于给出的文件是符号链接的, 就改变符号链接的本身,这比改变它指乡的对象更好.如果系统不支持符号链接的组所有权,那就对它不起作用.
- -H (half-logical[半逻辑?])
- (当和 -R 一起给出) 给出的文件操作数书指向目录的符号链接时,改变这个目录和目录中文件的组所有权
- -L (logical[(全)逻辑,想来是和上面的对应的])
- (当和 -R 一起给出.) 给出的文件,不论是命令行操作数还是遍历整个树,操作数书指向目录的符号链接时, 改变这个目录和目录中文件的组所有权.
- -P (physical)
- (当和 -R 一起给出.) 对于一个文件,不论是命令行操作数还是遍历整个树, 是符号链接的,只改变它本身, 优于(改变)指向的对象如果系统不支持符号链接的组所有权,那就对它不起作用.这是默认值.
- -R
- 递归的改变目录和它的内容的组所有权
额外的 GNU 描述
一个 GNU 扩展(***的在fileutils 4.0里)允许 --reference=rfile 作为组的描述:和 rfile 一样的组.
GNU 选项
- -c, --changes
- 详细描述对每一个文件的动作:实际上改变了哪个组。
- -f, --silent, --quiet
- 不列出错误信息.(那些组不能被改变).
- -h, --no-dereference
- 作用于符号链接本身代替它所指向的. 仅可用于 lchown 系统调用被提供时.
- -v, --verbose
- 详细描述作用或没作用的所有 文件.
- -R, --recursive
- 递归的改变目录和它的内容的组所有权
GNU 标准选项
- --help
- 显示使用方法到标准输出并退出.
- --version
- 显示版本信息到标准输出并退出.
环境变量
有以下变量是有通常的意义的 LANG, LC_ALL, LC_CTYPE 和 LC_MESSAGES.对于XSI-conforming系统:NLSPATH有通常的意义.
符合到
POSIX 1003.2 仅要求 -R 选项.使用其它选项不一定有效.
注意
这份 chgrp 描述同样可以在fileutils-4.0 包中找到; 其它版本也许些微有些差别. 把修正和更新邮到 aeb@cwi.nl. 漏洞报告邮到 fileutils-bugs@gnu.ai.mit.edu.
#p#
NAME
chgrp - change group ownership
SYNOPSIS
chgrp [OPTION]... GROUP FILE...
chgrp [OPTION]... --reference=RFILE FILE...
DESCRIPTION
Change the group of each FILE to GROUP. With --reference, change the group of each FILE to that of RFILE.
- -c, --changes
- like verbose but report only when a change is made
- --dereference
- affect the referent of each symbolic link, rather than the symbolic link itself (this is the default)
- -h, --no-dereference
- affect each symbolic link instead of any referenced file (useful only on systems that can change the ownership of a symlink)
- --no-preserve-root do not treat `/' specially (the default)
- --preserve-root
- fail to operate recursively on `/'
- -f, --silent, --quiet
- suppress most error messages
- --reference=RFILE
- use RFILE's group rather than the specifying GROUP value
- -R, --recursive
- operate on files and directories recursively
- -v, --verbose
- output a diagnostic for every file processed
The following options modify how a hierarchy is traversed when the -R option is also specified. If more than one is specified, only the final one takes effect.
- -H
- if a command line argument is a symbolic link to a directory, traverse it
- -L
- traverse every symbolic link to a directory encountered
- -P
- do not traverse any symbolic links (default)
- --help
- display this help and exit
- --version
- output version information and exit
AUTHOR
Written by David MacKenzie and Jim Meyering.
REPORTING BUGS
Report bugs to <bug-coreutils@gnu.org>.
COPYRIGHT
Copyright © 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
SEE ALSO
The full documentation for chgrp is maintained as a Texinfo manual. If the info and chgrp programs are properly installed at your site, the command
- info coreutils chgrp
should give you access to the complete manual.