User groups Chgrp and file owners who modified files under Linux Chown

Source: Internet
Author: User

1. Modify the file user group under Linux
Chgrp:change Group, modify the user group to which the file belongs.
CHGRP Users Test.log
View Ls-l after modification
-RWXRWX---  1 work users 0 June  8 15:46 Test.log
If you want to modify all files and directories under this directory, use the-r parameter.
Chgrp-r Users Test
The group name to be changed must be in the/etc/group file. The/etc/group file records all the group names in the system.
2. Modify the file owner under Linux
Chown:change owner's shorthand, modify the file owners.
Chown [-r] Account name  file or directory
-R recursion, modify all the files in the sub-directory.
Modify the file owner Bin
Chown bin Test.log
The modified user must log the user information/etc/passwd in the/etc/passwd file.
Chown can also repair the group name
Chown Root:root Test.log
Change both the owner and group name to root.
Address: http://blog.csdn.net/yonggang7/article/details/29369587

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.