How to change the file owner and group commands in chown

Source: Internet
Author: User

Chown can change the owner and group commands of files or directories on disks to facilitate permission Control for users.


Chown

[Syntax] chown [Options] [parameters]
[Details] The chown command is used to change the owner or group of a specified file or directory. When changing the file owner or group, you can use the user name and user ID settings.
[Parameters]


Option corresponding function-c displays the result only when there is a change. Changes is similar to-c. -- Dereference: Modify the object indicated by the symbolic link without changing the symbolic connection itself. -F: no error message is displayed. -- Quiet is the same as-f. -- Silent is the same as-f. -H: only modify the file of the symbolic link. do not modify the object indicated by the symbolic link. -R processes all files in the specified directory and subdirectory. -V shows the detailed process after the command is processed. -- Help: displays help information. -- Version: displays the version information.

[Description]


Keyword Description: The owner specifies to change the owner name of a file or directory. The name of the new group to which the specified file or directory belongs. File Name.
Example

Modify the owner and group of the relevant files in conjunction with the Lnmp one-click installation package.

For example, modify the owner of all files in/home/wwwroot/TO www, and the group to which the files belong is also www.

Then:


Cd/home/wwwroot # enter the chown-R www: www * #-R directory to recursively process all files and folders. The first www is the name of the file owner, the second www is the group. # "*" Indicates all files and folders

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.