Linux chown Command Detailed

Source: Internet
Author: User

Chown the owner of the specified file to the specified user or group, the user can be either a user name or a user ID; a group can be a group name or a group ID; a file is a space-separated list of files to change permissions, and wildcard characters are supported.

Chown Common Command Parameters
Usage:chown [OPTION] ... [OWNER] [: [GROUP]] File ... or:chown [OPTION] ...--reference=rfile file ...  Change the owner and/or group of each FILE to owner and/or group. -C,--changes like verbose if only if a change is made--dereference affect the referent of E Ach symbolic link (this is the default), rather than the symbolic link itself-h,--no-dereferenc e affect each symbolic link instead of any referenced file (useful-on systems that can Chan GE the ownership of a symlink)--from=current_owner:current_group cha Nge the owner and/or group of each file only if it current owner and/or group match those specifi  Ed here.      Either May was omitted, in which case a match was not required for the omitted attribute. --no-preserve-root do not treat '/' specially (the default)--presErve-root fail to operate recursively on '/'-F,--silent,--quiet suppress most error messages--reference=rfil E use Rfile ' s owner and group rather than specifying Owner:group values-r,--recursive o Perate on files and directories recursively-v,--verbose output a diagnostic for every file processedthe follow  ing options Modify how a hierarchy are traversed when the-roption is also specified.  If more than one are specified, only the finalone 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 Versio  n Information and Exitexamples: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 of/u and subfiles to "root".

Common Command Display

Change file owners and groups

Chown Omc:h.txt "Default is the genus group for the current user"
Chown omc:users H.txt

Linux chown Command Detailed

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.