Linux--Chown

Source: Internet
Author: User

CHOWN (1) User Commands CHOWN (1)



NAME
Chown-change file owner and group

Synopsis
chown [OPTION] ... [OWNER] [: [GROUP]] FILE ...
chown [OPTION] ...--reference=rfile FILE ...

DESCRIPTION
This manual page documents the GNU version of Chown.  Chown changes the user and/or group ownership of each given file. If only a owner (a
User name or numeric user ID) is given, which user is made the owner of each given file, and the files ' group isn't change D. 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 F Iles 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 Changed to
That user ' s login group. If the colon and group were given, but the owner was omitted, only the group of the files is changed; In the case,
Chown performs the same function as CHGRP. If only a colon are given, or if the entire operand is empty, and neither the owner nor the group is
Changed.

OPTIONS
Change the owner and/or group of each FILE to owner and/or group. With--reference, change the owner and group of all FILE to those of
Rfile.

1 #chown-R user:group dir2 Change the owner of Dir to user, group34# Chown  : Group file5 changes file owning user group as group


--reference=rfile
Use Rfile ' s owner and group rather than specifying Owner:group values

1 #chown--reference=FILE1  FILE22 change FILE2 User and user group to FILE1


-R,--recursive
operate on files and directories recursively


-C,--changes
Like verbose, but the report has a change is made

#只在有改变发生时报告


-V,--verbose
Output a diagnostic for every file processed



-F,--silent,--quiet
Suppress most error messages

#不报告错误


--dereference #不改变链接本身, change the content of the link
Affect the referent of each symbolic link (this is the default), rather than the symbolic link itself

-H,--no-dereference #改变链接本身, but does not change the contents of the link
affect symbolic links Instead of any referenced file (useful-in systems that can change the ownership of a symlink)

--from=current_owner:current_group
The change the owner and/or group of all file only if it current owner and/or group match those specified here. Either may omitted,
In which case a match isn't required for the omitted attribute

--no-preserve-root
Do not treat '/' specially (the default)

--preserve-root
Fail to operate recursively on '/'


The following options modify how a hierarchy was traversed when the-r option was also specified. If more than one are specified, only the
Final one takes effect.

-H if a command line argument are 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

Owner is unchanged if missing. Group is unchanged if missing, but changed to the login group if implied by a ': ' Following a symbolic OWNER.
OWNER and GROUP May is numeric as well as symbolic.

EXAMPLES
Chown root/u
Change the owner of/u to "root".

Chown root:staff/u
Likewise, but also the change it group to the "staff".

Chown-hr root/u
Change the owner of/u and subfiles to "root".

AUTHOR
Written by David MacKenzie and Jim meyering.

REPORTING BUGS
Report Chown bugs to [email protected]
GNU coreutils Home page: General help using GNU software: Report Chown translation Bugs to
COPYRIGHT
copyright©2013 Free Software Foundation, Inc. License gplv3+: GNU GPL version 3 or later This was free software:you was free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

See ALSO
Chown (2)

The full documentation-Chown is maintained as a Texinfo manual. If the info and chown programs is properly installed at your site, the
Command

Info coreutils ' Chown invocation '

Should give you access to the complete manual.



GNU Coreutils 8.21 March 2014 CHOWN (1)

Linux--Chown

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.