您的位置:首页 > 运维架构 > Linux

Linux - one command per day--chgrp

2011-12-27 17:34 274 查看
Date: 2011-11-27



chgrp(change group)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 (this is the default),

rather than the symbolic link itself

-h, --no-dereference

affect each symbolic link instead of any referenced file (useful

only on systems that can change the ownership of a symlink)

do not treat `/' specially (the default) 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 specifying a 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

chgrp(change group)

功能说明:变更文件或目录的所属群组。

语  法:chgrp [-cfhRv][--help][--version][所属群组][文件或目录...] 或 chgrp [-cfhRv][--help][--reference=<参考文件或目录>][--version][文件或目录...]

补充说明:在UNIX系统家族里,文件或目录权限的掌控以拥有者及所属群组来管理。您可以使用chgrp指令去变更文件与目录的所属群组,设置方式采用群组名称或群组识别码皆可。

参  数:

 -c或--changes 效果类似"-v"参数,但仅回报更改的部分。

 -f或--quiet或--silent  不显示错误信息。

 -h或--no-dereference  只对符号连接的文件作修改,而不更动其他任何相关文件。

 -R或--recursive  递归处理,将指定目录下的所有文件及子目录一并处理。

 -v或--verbose  显示指令执行过程。

 --help  在线帮助。

 --reference=<参考文件或目录>  把指定文件或目录的所属群组全部设成和参考文件或目录的所属群组相同。

 --version  显示版本信息。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: