Linux command (+): Chown command

Source: Internet
Author: User

1 . Command format:

chown [Options] ... Owner [: [Group]] file ...

2 . Command function:

Change the file owner and group by Chown. You can use the user name and user identification number settings when you change the owner or group of the file. Ordinary users cannot change their files to other owners. Its operation permissions are generally administrator

3. Command parameters:

 Necessary parameters:

-C Displays information about the changed parts

-F Ignore Error messages

-H Fix Symbolic link

-R handles all files in the specified directory and its subdirectories

-V displays detailed processing information

-deference acts on the point of a symbolic link, not the linked file itself

Example 1: Changing Owners and groups

[Email protected] home]# chown svn:svn test.log

[email protected] home]# LL

-rw-r--r--. 1 SVN svn 0 May 5 03:02 test.log

Example 2: Changing file owners and groups

[Email protected] home]# chown Root:test.log

[email protected] home]# LL

-rw-r--r--. 1 root root 0 May 5 03:02 test.log

Example 3: Changing file groups

[Email protected] home]# CHOWN:SVN Test.log

[email protected] home]# LL

-rw-r--r--. 1 root svn 0 May 5 03:02 test.log

Example 4: Changing the owner and group of all files in the specified directory and its subdirectories

Chown–r svn:root Test

Linux command (+): Chown command

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.