Linux Commands: Modify file Permissions command chmod, CHGRP, chown differences

Source: Internet
Author: User

Chmod is the right to change a file   Chown is the owner and genus of the modified file  Chgrp only the genus group that changed the file.

(1) chmod is the right to modify the file/directory. can have text modification and digital modification.

#chmod 777/home/berry

#chmod U+x/home/berry

Action object who is either or a combination of the following letters:

    • U means "user", which is the owner of the file or directory.
    • G means "same group user", that is, all users who have the same group ID as the file owner.
    • O means "other (others) users".
    • A means "all users". It is the system default value.

#chmod ug+w,o-x text

(2) CHGRP is a group that modifies a file or directory to which it belongs. ( just change the group of files )

#chgrp-R Guest/var/tmp/f.txt

# chgrp - R root/home/berry/file/a.txt

(3) chown modify File/directory owner and group. ( the owner and the genus of the document are changed )

#chown Guest:guest A.txt

#chown-R Guest/home/berry (change all files under the Berry file to the guest group)

Linux Commands: Modify file Permissions command chmod, CHGRP, chown differences

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.