151 lines
3.8 KiB
HTML
151 lines
3.8 KiB
HTML
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||
|
<html>
|
||
|
<head>
|
||
|
<meta name="generator" content="HTML Tidy, see www.w3.org">
|
||
|
<meta http-equiv="Content-Type" content=
|
||
|
"text/html; charset=utf-8">
|
||
|
<title>chgrp - Change file group ownership</title>
|
||
|
<LINK rel="stylesheet" type="text/css" href="../rzahg/ic.css">
|
||
|
</HEAD>
|
||
|
<body bgcolor="#FFFFFF">
|
||
|
<!-- Java sync-link -->
|
||
|
<SCRIPT LANGUAGE="Javascript" SRC="../rzahg/synch.js" TYPE="text/javascript"></SCRIPT>
|
||
|
|
||
|
|
||
|
|
||
|
<h2>chgrp - Change file group ownership</h2>
|
||
|
|
||
|
<strong>Synopsis</strong>
|
||
|
|
||
|
<p><strong>chgrp [-R [ -H | -L | -P ]] [ -h ]</strong> <em>
|
||
|
group</em> <em>file ...</em></p>
|
||
|
|
||
|
<p><strong>Description</strong></p>
|
||
|
|
||
|
<p>You can use <strong>chgrp</strong> to set the group of <em>
|
||
|
file</em> to the group identifier or profile specified by <em>
|
||
|
group</em>.</p>
|
||
|
|
||
|
<p>To change the group identifier, you must have one of the
|
||
|
following authorities:</p>
|
||
|
|
||
|
<ul>
|
||
|
<li>The current user has *ALLOBJ special authority.</li>
|
||
|
|
||
|
<li>The current user is the owner of <em>file</em> and either one
|
||
|
of the following:
|
||
|
|
||
|
<ul>
|
||
|
<li>The primary group of the job is <em>group</em>.</li>
|
||
|
|
||
|
<li>One of the supplemental groups of the job is <em>
|
||
|
group</em>.</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
</ul>
|
||
|
|
||
|
<p>In addition, the current user must have *USE authority to the
|
||
|
group profile specified by <em>group</em>.</p>
|
||
|
|
||
|
<p>By default, <strong>chgrp</strong> follows symbolic links and
|
||
|
changes the group of the file pointed to by the symbolic link.</p>
|
||
|
|
||
|
<p>The <strong>-H</strong>, <strong>-L</strong> and <strong>
|
||
|
-P</strong> options are ignored unless the <strong>-R</strong>
|
||
|
option is specified. In addition, these options override each other
|
||
|
and the command's actions are determined by the last one
|
||
|
specified.</p>
|
||
|
|
||
|
<p><img src="delta.gif" alt="Start of change">
|
||
|
The group of a file cannot be the same as the owner of the file.
|
||
|
<img src="deltaend.gif" alt="End of change"></p>
|
||
|
|
||
|
<p><strong>Options</strong></p>
|
||
|
|
||
|
<dl>
|
||
|
<dt><strong>-H</strong></dt>
|
||
|
|
||
|
<dd>If the <strong>-R</strong> option is specified, symbolic links
|
||
|
on the command line are followed. Symbolic links encountered in the
|
||
|
tree traversal are not followed.</dd>
|
||
|
|
||
|
<dt><strong>-L</strong></dt>
|
||
|
|
||
|
<dd>If the <strong>-R</strong> option is specified, both symbolic
|
||
|
links on the command line and symbolic links encountered in the
|
||
|
tree traversal are followed.</dd>
|
||
|
|
||
|
<dt><strong>-P</strong></dt>
|
||
|
|
||
|
<dd>If the <strong>-R</strong> option is specified, no symbolic
|
||
|
links are followed.</dd>
|
||
|
|
||
|
<dt><strong>-R</strong></dt>
|
||
|
|
||
|
<dd>If <em>file</em> is a directory, <strong>chgrp</strong>
|
||
|
recursively changes the group of each file in the entire subtree
|
||
|
connected at that point.</dd>
|
||
|
|
||
|
<dt><strong>-h</strong></dt>
|
||
|
|
||
|
<dd>Change the owner and group of a symbolic link instead of the
|
||
|
file pointed to by the symbolic link.</dd>
|
||
|
</dl>
|
||
|
|
||
|
<p><strong>Operands</strong></p>
|
||
|
|
||
|
<p>The <em>group</em> operand specifies either a group identifier
|
||
|
number or group profile name. The <em>file</em> operand specifies a
|
||
|
path name to an object.</p>
|
||
|
|
||
|
<p><strong>Exit Status</strong></p>
|
||
|
|
||
|
<ul>
|
||
|
<li>0 when successful and all requested changes were made.</li>
|
||
|
|
||
|
<li>>0 when an error occurred.</li>
|
||
|
</ul>
|
||
|
|
||
|
<p><strong>Related information</strong></p>
|
||
|
|
||
|
<ul>
|
||
|
<li><a href="chmod.htm">chmod - Change file modes
|
||
|
(permissions)</a></li>
|
||
|
|
||
|
<li><a href="chown.htm">chown - Change file ownership</a></li>
|
||
|
</ul>
|
||
|
|
||
|
<strong>Examples</strong>
|
||
|
|
||
|
<ol>
|
||
|
<li>Change the group to group profile "abbey" for the file
|
||
|
"newgui.java".
|
||
|
|
||
|
<pre>
|
||
|
chgrp abbey newgui.java
|
||
|
</pre>
|
||
|
</li>
|
||
|
|
||
|
<li>Change the group to group profile "managers" for the
|
||
|
subdirectory "personal.dir" and all files and subdirectories below
|
||
|
this directory.
|
||
|
|
||
|
<pre>
|
||
|
chgrp -R managers personal.dir
|
||
|
</pre>
|
||
|
</li>
|
||
|
|
||
|
<li>Change the group to group identifier "442" for the file
|
||
|
"memo.txt".
|
||
|
|
||
|
<pre>
|
||
|
chgrp 442 memo.txt
|
||
|
</pre>
|
||
|
</li>
|
||
|
</ol>
|
||
|
|
||
|
<!-- end ibmbody========================================================= -->
|
||
|
</body>
|
||
|
</html>
|
||
|
|