Chown Change file owner and owner group

Source: Internet
Author: User
1. Role

Change the owner and owner group of one or more files or directories. The usage permission is superuser. 2. Format

chown [Options] User or group file 3. Main parameters

–dereference: Affected is the object indicated by the symbolic link, not the symbolic link itself.
-h,–no-dereference: The symbolic link itself is affected, not the destination indicated by the symbolic link (this option is valid when the system supports changing the owner of the symbolic link).
–from= Current owner: The current group changes the owner and group only if the owner and group of each file match the options specified. One of them can be omitted, and this omitted attribute does not need to conform to the original property.
-f,–silent,–quiet: Remove most of the error messages.
-r,–recursive: Recursively process all files and subdirectories.
-v,–verbose: Processing Any file will display information. 4. Description

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, and a file is a space separate list of files to change permissions, and wildcard characters are supported. System administrators often use the Chown command to let a user have permission to use the file after copying it to another user's directory. 5. Application Examples

1. Change the owner of the file Shiyan.c to Wan

$ chown Wan Shiyan.c

2. Change the owner of the directory/hi and all the files and subdirectories under it to the WAN, and change the group to users.

$ chown-r Wan.users/hi

Suppose there is a user hrb, to add him to the HLJ group, you should use that command.

Usermod-g Hlj HRB

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.