Linux system (and Mac System) chmod Modify Permissions Summary

Source: Internet
Author: User

Modifying file permissions on the terminal of the MAC system is using the chmod command in Linux.

chmod user + actions + permissions + files

User section: Using the letter U for the file owner (user), G for the owner's Group (group), O for other users (other), A for all users (all, including the previous three user ranges)

Action section: the "+" symbol indicates an increase in permissions, "-" symbol for the cancellation of permissions, "=" Symbol for assignment permissions

Permission section: "R" Symbol for readable (read), "W" for Writable (write), "X" for executable permission (execute)

File section: If you do not specify a file name, the action object is all files in the current directory

chmod +x a.jsAdd executable a.js file permissions for all users

In the Linux or Mac terminal first input ll , you can see such as:

-rw-r--r--

(altogether 10 parameters) represents the corresponding permissions for the group and user to which the file belongs.

The first parameter belongs to the administrator, regardless of chmod, first, only look at the post 9.

2-4 parameter: belongs to user

5-7 parameter: belongs to group

8-10 parameter: belongs to others

Chmod can also use numbers to indicate permissions such aschmod 777 file

The syntax is:chmod abc file

Each of the a,b,c is a number that represents the permissions of the user, Group, and other respectively.

R=4,w=2,x=1

To rwx the property, 4+2+1=7

To rw-the property, 4+2=6

To r-x the property, 4+1=5

755 represents rwxr-xr-x , 777 stands rwxrwxrwx for, that is, all users are readable writable executables.

Linux system (and Mac System) chmod Modify Permissions Summary

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.