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. [Parameter] option function

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


Chown

[Syntax]Chown [option] [parameter]
[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 Functions
-C Results are displayed only when changes are made.
Changes Same as-c.
-- Dereference Modify the object indicated by the symbolic link. do not change the symbolic connection itself.
-F No error message is displayed.
-- Quiet Same as-f.
-- Silent Same as-f.
-H Only modify the file of the symbolic link. do not modify the object indicated by the symbolic link.
-R Process all files in the specified directory and subdirectory.
-V Displays the detailed process after the command is processed.
-- Help Displays help information.
-- Version Displays version information.

[Description]


Keywords Introduction
Owner Change the owner name of a file or directory.
Group Name of the new group to which the file or directory belongs.
File Specifies the name of the file to be changed.

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.