File: coreutils.info, Node: chgrp invocation, Next: chmod invocation, Up: Changing file attributes
13.2 `chgrp': Change group ownership
====================================
`chgrp' changes the group ownership of each given FILE to GROUP (which
can be either a group name or a numeric group ID) or to the group of an
existing reference file. Synopsis:
chgrp [OPTION]... {GROUP | --reference=REF_FILE} FILE...
The program accepts the following options. Also see *Note Common
options::.
`-c'
`--changes'
Verbosely describe the action for each FILE whose group actually
changes.
`-f'
`--silent'
`--quiet'
Do not print error messages about files whose group cannot be
changed.
`--dereference'
Do not act on symbolic links themselves but rather on what they
point to. This is the default.
`-h'
`--no-dereference'
Act on symbolic links themselves instead of what they point to.
This mode relies on the `lchown' system call. On systems that do
not provide the `lchown' system call, `chgrp' fails when a file
specified on the command line is a symbolic link. By default, no
diagnostic is issued for symbolic links encountered during a
recursive traversal, but see `--verbose'.
`--preserve-root'
Fail upon any attempt to recursively change the file system root,
`/'. Without `--recursive', this option has no effect. *Note
Treating / specially::.
`--no-preserve-root'
Cancel the effect of any preceding `--preserve-root' option.
*Note Treating / specially::.
`--reference=REF_FILE'
Change the group of each FILE to be the same as that of REF_FILE.
If REF_FILE is a symbolic link, do not use the group of the
symbolic link, but rather that of the file it refers to.
`-v'
`--verbose'
Output a diagnostic for every file processed. If a symbolic link
is encountered during a recursive traversal on a system without
the `lchown' system call, and `--no-dereference' is in effect,
then issue a diagnostic saying neither the symbolic link nor its
referent is being changed.
`-R'
`--recursive'
Recursively change the group ownership of directories and their
contents.
`-H'
If `--recursive' (`-R') is specified and a command line argument
is a symbolic link to a directory, traverse it. *Note Traversing
symlinks::.
`-L'
In a recursive traversal, traverse every symbolic link to a
directory that is encountered. *Note Traversing symlinks::.
`-P'
Do not traverse any symbolic links. This is the default if none
of `-H', `-L', or `-P' is specified. *Note Traversing symlinks::.
An exit status of zero indicates success, and a nonzero value
indicates failure.
Examples:
# Change the group of /u to "staff".
chgrp staff /u
# Change the group of /u and subfiles to "staff".
chgrp -hR staff /u
Generated by $Id: phpMan.php,v 4.49 2006/02/26 13:18:18 chedong Exp $ Author: Che Dong
On Apache/1.3.37 (Unix) mod_throttle/3.1.2 FrontPage/5.0.2.2635 mod_psoft_traffic/0.2 mod_ssl/2.8.28 OpenSSL/0.9.8b
Under GNU General Public License
2008-11-20 19:46 @38.103.63.55 Crawled by CCBot/1.0 (+http://www.commoncrawl.org/bot.html)