175 lines
5.6 KiB
HTML
175 lines
5.6 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of CHOWN</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>CHOWN</H1>
|
|
Section: User Commands (1)<BR>Updated: September 2019<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
chown - change file owner and group
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<B>chown</B>
|
|
|
|
[<I>,OPTION/</I>]... [<I>,OWNER/</I>][<I>,:/</I>[<I>,GROUP/</I>]] <I>,FILE/</I>...
|
|
<BR>
|
|
|
|
<B>chown</B>
|
|
|
|
[<I>,OPTION/</I>]... <I>,--reference=RFILE FILE/</I>...
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
This manual page
|
|
documents the GNU version of
|
|
<B>chown</B>.
|
|
|
|
<B>chown</B>
|
|
|
|
changes the user and/or group ownership of each given file. If
|
|
only an owner (a user name or numeric user ID) is given, that user is made the
|
|
owner of each given file, and the files' group is not changed. If the
|
|
owner is followed by a colon and a group name (or numeric group ID),
|
|
with no spaces between them, the group ownership of the files is
|
|
changed as well. If a colon but no group name follows the user name,
|
|
that user is made the owner of the files and the group of the files is
|
|
changed to that user's login group. If the colon and group are given,
|
|
but the owner is omitted, only the group of the files is changed;
|
|
in this case,
|
|
<B>chown</B>
|
|
|
|
performs the same function as
|
|
<B>chgrp</B>.
|
|
|
|
If only a colon is given, or if the entire operand is empty, neither the
|
|
owner nor the group is changed.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>OPTIONS</H2>
|
|
|
|
<P>
|
|
|
|
Change the owner and/or group of each FILE to OWNER and/or GROUP.
|
|
With <B>--reference</B>, change the owner and group of each FILE to those of RFILE.
|
|
<DL COMPACT>
|
|
<DT id="1"><B>-c</B>, <B>--changes</B><DD>
|
|
like verbose but report only when a change is made
|
|
<DT id="2"><B>-f</B>, <B>--silent</B>, <B>--quiet</B><DD>
|
|
suppress most error messages
|
|
<DT id="3"><B>-v</B>, <B>--verbose</B><DD>
|
|
output a diagnostic for every file processed
|
|
<DT id="4"><B>--dereference</B><DD>
|
|
affect the referent of each symbolic link (this is
|
|
the default), rather than the symbolic link itself
|
|
<DT id="5"><B>-h</B>, <B>--no-dereference</B><DD>
|
|
affect symbolic links instead of any referenced file
|
|
(useful only on systems that can change the
|
|
ownership of a symlink)
|
|
<DT id="6"><B>--from</B>=<I>,CURRENT_OWNER/</I>:CURRENT_GROUP<DD>
|
|
change the owner and/or group of each file only if
|
|
its current owner and/or group match those specified
|
|
here. Either may be omitted, in which case a match
|
|
is not required for the omitted attribute
|
|
<DT id="7"><B>--no-preserve-root</B><DD>
|
|
do not treat '/' specially (the default)
|
|
<DT id="8"><B>--preserve-root</B><DD>
|
|
fail to operate recursively on '/'
|
|
<DT id="9"><B>--reference</B>=<I>,RFILE/</I><DD>
|
|
use RFILE's owner and group rather than
|
|
specifying OWNER:GROUP values
|
|
<DT id="10"><B>-R</B>, <B>--recursive</B><DD>
|
|
operate on files and directories recursively
|
|
</DL>
|
|
<P>
|
|
|
|
The following options modify how a hierarchy is traversed when the <B>-R</B>
|
|
option is also specified. If more than one is specified, only the final
|
|
one takes effect.
|
|
<DL COMPACT>
|
|
<DT id="11"><B>-H</B><DD>
|
|
if a command line argument is a symbolic link
|
|
to a directory, traverse it
|
|
<DT id="12"><B>-L</B><DD>
|
|
traverse every symbolic link to a directory
|
|
encountered
|
|
<DT id="13"><B>-P</B><DD>
|
|
do not traverse any symbolic links (default)
|
|
<DT id="14"><B>--help</B><DD>
|
|
display this help and exit
|
|
<DT id="15"><B>--version</B><DD>
|
|
output version information and exit
|
|
</DL>
|
|
<P>
|
|
|
|
Owner is unchanged if missing. Group is unchanged if missing, but changed
|
|
to login group if implied by a ':' following a symbolic OWNER.
|
|
OWNER and GROUP may be numeric as well as symbolic.
|
|
<A NAME="lbAF"> </A>
|
|
<H2>EXAMPLES</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="16">chown root /u<DD>
|
|
Change the owner of /u to "root".
|
|
<DT id="17">chown root:staff /u<DD>
|
|
Likewise, but also change its group to "staff".
|
|
<DT id="18">chown -hR root /u<DD>
|
|
Change the owner of /u and subfiles to "root".
|
|
</DL>
|
|
<A NAME="lbAG"> </A>
|
|
<H2>AUTHOR</H2>
|
|
|
|
Written by David MacKenzie and Jim Meyering.
|
|
<A NAME="lbAH"> </A>
|
|
<H2>REPORTING BUGS</H2>
|
|
|
|
GNU coreutils online help: <<A HREF="https://www.gnu.org/software/coreutils/">https://www.gnu.org/software/coreutils/</A>>
|
|
<BR>
|
|
|
|
Report chown translation bugs to <<A HREF="https://translationproject.org/team/">https://translationproject.org/team/</A>>
|
|
<A NAME="lbAI"> </A>
|
|
<H2>COPYRIGHT</H2>
|
|
|
|
Copyright © 2018 Free Software Foundation, Inc.
|
|
License GPLv3+: GNU GPL version 3 or later <<A HREF="https://gnu.org/licenses/gpl.html">https://gnu.org/licenses/gpl.html</A>>.
|
|
<BR>
|
|
|
|
This is free software: you are free to change and redistribute it.
|
|
There is NO WARRANTY, to the extent permitted by law.
|
|
<A NAME="lbAJ"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<A HREF="/cgi-bin/man/man2html?2+chown">chown</A>(2)
|
|
<P>
|
|
|
|
<BR>
|
|
|
|
Full documentation at: <<A HREF="https://www.gnu.org/software/coreutils/chown">https://www.gnu.org/software/coreutils/chown</A>>
|
|
<BR>
|
|
|
|
or available locally via: info '(coreutils) chown invocation'
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="19"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="20"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="21"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="22"><A HREF="#lbAE">OPTIONS</A><DD>
|
|
<DT id="23"><A HREF="#lbAF">EXAMPLES</A><DD>
|
|
<DT id="24"><A HREF="#lbAG">AUTHOR</A><DD>
|
|
<DT id="25"><A HREF="#lbAH">REPORTING BUGS</A><DD>
|
|
<DT id="26"><A HREF="#lbAI">COPYRIGHT</A><DD>
|
|
<DT id="27"><A HREF="#lbAJ">SEE ALSO</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:09 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|