Linux modify file and directory permissions chmod

Source: Internet
Author: User

1. Introduction to file Permissions
There are 9 Linux file permissions, three groups representing, owner, group, others, each group also contains r,w, x three states.
2. Modify permissions based on numbers
R, W, x Three permissions are represented by numbers: R:4w:2x:1 the permissions for each group are added to the above three. such as permission for; [-rwxrwx---]owner:rwx = 4 + 2 + 1 = 7group:rwx = 4 + 2 +1 = 7others:---= 0 + 0 + 0 = 0 The corresponding permission is 770
chmod 770  test.log# recursively modifies subdirectories chmod-r 770 test
For example: [-rw-r--r--] corresponds to 644. chmod 754 file permission is [-rwxr-xr--]
3. Modify permissions based on symbol type
User, group, others are represented by u, G, O, and a for all. + Add-subtract = set
chmod u=rwx,go=rx test.log# Rights [-rwxr-xr-x]
Increase execution permissions
chmod a+w test.log# Rights [-RWXRWXRWX]
Remove Execute Permissions
chmod a-x test.log# Rights [-rw-rw-rw-]


Address: http://blog.csdn.net/yonggang7/article/details/29379595
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.