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