Chmod method of using numbers to represent permissions

Source: Internet
Author: User

Prerequisites:

Mode permission set string, format: [Ugoa ...] [[+-=][RWXX] ...] [,...]

where u represents the owner (user), g means that the owner belongs to the same group (group), O denotes other persons (other), and a shows all three;

+ means to increase the permissions,-the cancellation permission, = The unique set of permissions;

R: Indicates readable, w indicates writable, and X indicates executable.


syntax: chmod ABC file

Where A,b,c is a number, a means that user,b represents Group,c's permission to represent other.

R=4,w=2,x=1

To rwx (readable, writable, executable) properties, 4+2+1=7

To rw-(readable, writable, non-executable) properties, 4+2=6

To R-w (readable, non-writable, executable) properties, 4+1=5


Example:

chmod a=rwx file and chmod 777 file effect are the same

chmod ug=rwx,o=x file and chmod 771 file effect are the same

Use chmod 4755 filename to give the program root privileges




Chmod method of using numbers to represent permissions

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.